增加了组件的局部禁用方法

This commit is contained in:
UnCLAS-Prommer
2025-07-23 00:41:31 +08:00
parent 87dd9a3756
commit 10bf424540
14 changed files with 195 additions and 162 deletions

View File

@@ -418,7 +418,7 @@ class ComponentRegistry:
"""获取Command模式注册表"""
return self._command_patterns.copy()
def find_command_by_text(self, text: str) -> Optional[Tuple[Type[BaseCommand], dict, bool, str]]:
def find_command_by_text(self, text: str) -> Optional[Tuple[Type[BaseCommand], dict, CommandInfo]]:
# sourcery skip: use-named-expression, use-next
"""根据文本查找匹配的命令
@@ -439,8 +439,7 @@ class ComponentRegistry:
return (
self._command_registry[command_name],
candidates[0].match(text).groupdict(), # type: ignore
command_info.intercept_message,
command_info.plugin_name,
command_info,
)
# === 事件处理器特定查询方法 ===