simplify and refactor the rest some code

This commit is contained in:
crazywhalecc
2023-01-02 23:17:23 +08:00
parent 1abdfc761d
commit 7d9a8a5ee1
2 changed files with 3 additions and 11 deletions

View File

@@ -58,7 +58,7 @@ class OneBot12Adapter extends ZMPlugin
// 处理和声明所有 BotCommand 下的 CommandArgument
$parser->addSpecialParser(BotCommand::class, [$this, 'parseBotCommand']);
// 不需要给列表写入 CommandArgument
$parser->addSpecialParser(CommandArgument::class, [$this, 'parseCommandArgument']);
$parser->addSpecialParser(CommandArgument::class, fn () => true);
break;
case 'onebot12-ban-other-ws':
// 禁止其他类型的 WebSocket 客户端接入
@@ -86,14 +86,6 @@ class OneBot12Adapter extends ZMPlugin
return null;
}
/**
* 忽略解析记录 CommandArgument 注解
*/
public function parseCommandArgument(): ?bool
{
return true;
}
/**
* [CALLBACK] 调用 BotCommand 注解的方法
*