fix(command): 排除已禁用指令的冲突检测

- 只有 `effective_command` 存在且 `enabled` 为 `True` 的指令才会被纳入冲突检测范围。
This commit is contained in:
Ocetars
2025-12-03 14:43:18 +08:00
parent 3da0c77e87
commit 8144b61ae0
+2 -2
View File
@@ -138,7 +138,7 @@ async def list_commands() -> list[dict[str, Any]]:
# 检测冲突:按 effective_command 分组
conflict_groups: dict[str, list[CommandDescriptor]] = defaultdict(list)
for desc in descriptors:
if desc.effective_command:
if desc.effective_command and desc.enabled:
conflict_groups[desc.effective_command].append(desc)
conflict_handler_names: set[str] = set()
@@ -165,7 +165,7 @@ async def list_command_conflicts() -> list[dict[str, Any]]:
conflicts = defaultdict(list)
for desc in descriptors:
if not desc.effective_command:
if not desc.effective_command or not desc.enabled:
continue
conflicts[desc.effective_command].append(desc)