Add PlusCommand enhanced command system

Introduces the PlusCommand system for simplified command development, including new base classes, argument parsing utilities, and registration logic. Updates the plugin system, component registry, and bot message handling to support PlusCommand components alongside traditional commands. Adds documentation and configuration for command prefixes, and provides a developer guide for the new system.
This commit is contained in:
雅诺狐
2025-08-27 22:21:03 +08:00
committed by Windpicker-owo
parent 0616623e71
commit a2873a71ef
13 changed files with 1135 additions and 22 deletions

View File

@@ -1,13 +1,14 @@
from abc import abstractmethod
from typing import List, Type, Tuple, Union
from typing import List, Type, Tuple, Union, TYPE_CHECKING
from .plugin_base import PluginBase
from src.common.logger import get_logger
from src.plugin_system.base.component_types import ActionInfo, CommandInfo, EventHandlerInfo, ToolInfo
from src.plugin_system.base.component_types import ActionInfo, CommandInfo, PlusCommandInfo, EventHandlerInfo, ToolInfo
from .base_action import BaseAction
from .base_command import BaseCommand
from .base_events_handler import BaseEventHandler
from .base_tool import BaseTool
from .plus_command import PlusCommand
logger = get_logger("base_plugin")
@@ -31,6 +32,7 @@ class BasePlugin(PluginBase):
Union[
Tuple[ActionInfo, Type[BaseAction]],
Tuple[CommandInfo, Type[BaseCommand]],
Tuple[PlusCommandInfo, Type[PlusCommand]],
Tuple[EventHandlerInfo, Type[BaseEventHandler]],
Tuple[ToolInfo, Type[BaseTool]],
]