From db526e944459b269a85717c29806ce01c473a290 Mon Sep 17 00:00:00 2001 From: MiaoWoo Date: Sat, 2 Apr 2022 15:02:21 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=96=E5=91=BD=E4=BB=A4=E5=8F=82=E6=95=B0=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: MiaoWoo --- packages/api/src/plugin.ts | 2 +- packages/plugin/src/command.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/api/src/plugin.ts b/packages/api/src/plugin.ts index d45457c0..90bf21a9 100644 --- a/packages/api/src/plugin.ts +++ b/packages/api/src/plugin.ts @@ -20,7 +20,7 @@ export namespace plugin { export abstract class PluginManager { abstract scan(folder: string): void abstract build(): void - abstract loadFromFile(file: string, scanner?: plugin.PluginScanner): Plugin + abstract loadFromFile(file: string, ext: any): Plugin abstract load(...args: any[]): void abstract enable(...args: any[]): void abstract disable(...args: any[]): void diff --git a/packages/plugin/src/command.ts b/packages/plugin/src/command.ts index a9808671..0c0f2c90 100644 --- a/packages/plugin/src/command.ts +++ b/packages/plugin/src/command.ts @@ -56,8 +56,9 @@ export class PluginCommandManager { let cmdKey = 'cmd' + subcommand let subcommandexec = pluginInstance[cmdKey] if (!subcommandexec) { - args.shift() subcommandexec = pluginInstance['cmdmain'] + } else { + args.shift() } if (!subcommandexec) { subcommand && pluginInstance.logger.sender(sender, '§4未知的子命令: §c' + subcommand)