From 8144b61ae071b519456035b0f8c7795a4e16b2ec Mon Sep 17 00:00:00 2001 From: Ocetars Date: Wed, 3 Dec 2025 14:43:18 +0800 Subject: [PATCH] =?UTF-8?q?fix(command):=20=E6=8E=92=E9=99=A4=E5=B7=B2?= =?UTF-8?q?=E7=A6=81=E7=94=A8=E6=8C=87=E4=BB=A4=E7=9A=84=E5=86=B2=E7=AA=81?= =?UTF-8?q?=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 只有 `effective_command` 存在且 `enabled` 为 `True` 的指令才会被纳入冲突检测范围。 --- astrbot/core/star/command_management.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/astrbot/core/star/command_management.py b/astrbot/core/star/command_management.py index cf3cd2195..8d36e9aee 100644 --- a/astrbot/core/star/command_management.py +++ b/astrbot/core/star/command_management.py @@ -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)