diff --git a/astrbot/core/star/register/star_handler.py b/astrbot/core/star/register/star_handler.py index 0ce325c09..ad378ce85 100644 --- a/astrbot/core/star/register/star_handler.py +++ b/astrbot/core/star/register/star_handler.py @@ -139,7 +139,6 @@ def register_command_group( '''注册一个 CommandGroup ''' new_group = None - add_to_event_filters = False if isinstance(command_group_name, RegisteringCommandable): # 子指令组 new_group = CommandGroupFilter(sub_command, alias, parent_group=command_group_name.parent_group) @@ -147,13 +146,11 @@ def register_command_group( else: # 根指令组 new_group = CommandGroupFilter(command_group_name, alias) - add_to_event_filters = True def decorator(obj): - if add_to_event_filters: - # 根指令组 - handler_md = get_handler_or_create(obj, EventType.AdapterMessageEvent, **kwargs) - handler_md.event_filters.append(new_group) + # 根指令组 + handler_md = get_handler_or_create(obj, EventType.AdapterMessageEvent, **kwargs) + handler_md.event_filters.append(new_group) return RegisteringCommandable(new_group) diff --git a/astrbot/dashboard/routes/plugin.py b/astrbot/dashboard/routes/plugin.py index 77774075d..545ed3a95 100644 --- a/astrbot/dashboard/routes/plugin.py +++ b/astrbot/dashboard/routes/plugin.py @@ -119,7 +119,7 @@ class PluginRoute(Route): info["cmd"] = f"{self.core_lifecycle.astrbot_config['wake_prefix'][0]}{info['cmd']}" elif isinstance(filter, CommandGroupFilter): info["type"] = "指令组" - info["cmd"] = filter.group_name + info["cmd"] = filter.get_complete_command_names()[0] info["cmd"] = info["cmd"].strip() info["sub_command"] = filter.print_cmd_tree(filter.sub_command_filters) if self.core_lifecycle.astrbot_config['wake_prefix'] and len(self.core_lifecycle.astrbot_config['wake_prefix']) > 0: