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

@@ -44,6 +44,7 @@ from src.config.official_configs import (
MonthlyPlanSystemConfig,
CrossContextConfig,
PermissionConfig,
CommandConfig,
MaizoneIntercomConfig,
)
@@ -395,6 +396,7 @@ class Config(ValidatedConfigBase):
voice: VoiceConfig = Field(..., description="语音配置")
schedule: ScheduleConfig = Field(..., description="调度配置")
permission: PermissionConfig = Field(..., description="权限配置")
command: CommandConfig = Field(..., description="命令系统配置")
# 有默认值的字段放在后面
anti_prompt_injection: AntiPromptInjectionConfig = Field(default_factory=lambda: AntiPromptInjectionConfig(), description="反提示注入配置")

View File

@@ -697,6 +697,12 @@ class MaizoneIntercomConfig(ValidatedConfigBase):
groups: List[ContextGroup] = Field(default_factory=list, description="Maizone互通组列表")
class CommandConfig(ValidatedConfigBase):
"""命令系统配置类"""
command_prefixes: List[str] = Field(default_factory=lambda: ['/', '!', '.', '#'], description="支持的命令前缀列表")
class PermissionConfig(ValidatedConfigBase):
"""权限系统配置类"""