From 460a1319cede9e9e44a738cdd4ff1773839f6637 Mon Sep 17 00:00:00 2001 From: Windpicker-owo <3431391539@qq.com> Date: Tue, 9 Sep 2025 14:54:30 +0800 Subject: [PATCH] 1 --- .gitignore | 3 +++ src/plugin_system/base/plus_command.py | 24 +----------------------- 2 files changed, 4 insertions(+), 23 deletions(-) diff --git a/.gitignore b/.gitignore index 18085f317..f03fa1b26 100644 --- a/.gitignore +++ b/.gitignore @@ -338,3 +338,6 @@ MaiBot.code-workspace .kilocode/rules/MoFox.md src/chat/planner_actions/planner (2).py rust_video/Cargo.lock +.claude/settings.local.json +package-lock.json +package.json diff --git a/src/plugin_system/base/plus_command.py b/src/plugin_system/base/plus_command.py index ffa02baf1..0d9780ada 100644 --- a/src/plugin_system/base/plus_command.py +++ b/src/plugin_system/base/plus_command.py @@ -8,7 +8,7 @@ from typing import Tuple, Optional, List import re from src.common.logger import get_logger -from src.plugin_system.base.component_types import CommandInfo, PlusCommandInfo, ComponentType, ChatType +from src.plugin_system.base.component_types import PlusCommandInfo, ComponentType, ChatType from src.chat.message_receive.message import MessageRecv from src.plugin_system.apis import send_api from src.plugin_system.base.command_args import CommandArgs @@ -288,28 +288,6 @@ class PlusCommand(ABC): return await send_api.image_to_stream(image_base64, chat_stream.stream_id) - @classmethod - def get_command_info(cls) -> "CommandInfo": - """从类属性生成CommandInfo - - Returns: - CommandInfo: 生成的命令信息对象 - """ - if "." in cls.command_name: - logger.error(f"命令名称 '{cls.command_name}' 包含非法字符 '.',请使用下划线替代") - raise ValueError(f"命令名称 '{cls.command_name}' 包含非法字符 '.',请使用下划线替代") - - # 生成正则表达式模式来匹配命令 - command_pattern = cls._generate_command_pattern() - - return CommandInfo( - name=cls.command_name, - component_type=ComponentType.COMMAND, - description=cls.command_description, - command_pattern=command_pattern, - chat_type_allow=getattr(cls, "chat_type_allow", ChatType.ALL), - ) - @classmethod def get_plus_command_info(cls) -> "PlusCommandInfo": """从类属性生成PlusCommandInfo