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:
@@ -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="反提示注入配置")
|
||||
|
||||
@@ -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):
|
||||
"""权限系统配置类"""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user