fix generate command list events not exists

This commit is contained in:
sunxyw
2022-05-03 16:11:15 +08:00
parent 707a1ae628
commit 7df05df48f

View File

@@ -134,12 +134,7 @@ class CommandInfoUtil
{
$commands = [];
foreach (EventManager::$events[CQCommand::class] as $annotation) {
// 正常来说不可能,但保险起见需要判断
if (!$annotation instanceof CQCommand) {
continue;
}
foreach (EventManager::$events[CQCommand::class] ?? [] as $annotation) {
$id = "{$annotation->class}@{$annotation->method}";
try {