diff --git a/astrbot/core/star/filter/command.py b/astrbot/core/star/filter/command.py index e5400a757..9ceed54a9 100755 --- a/astrbot/core/star/filter/command.py +++ b/astrbot/core/star/filter/command.py @@ -153,17 +153,10 @@ class CommandFilter(HandlerFilter): _full = f"{parent_command_name} {candidate}" else: _full = candidate - if message_str == _full: - # 完全等于命令名 → 没参数 - message_str = "" + if message_str.startswith(f"{_full} ") or message_str == _full: + message_str = message_str[len(_full) :].strip() ok = True break - elif message_str.startswith(_full): - # 命令名后面无论是空格还是直接连参数都可以 - message_str = message_str[len(_full) :].lstrip() - ok = True - break - if not ok: return False