From 4d36ffcb085ca23cbf7e5a74129c0bd2aa61d73b Mon Sep 17 00:00:00 2001 From: Soulter <905617992@qq.com> Date: Sat, 25 May 2024 18:46:38 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E7=9A=84=E7=BB=93=E6=9E=9C=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- model/command/command.py | 2 ++ type/command.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/model/command/command.py b/model/command/command.py index b32f97fe..9972e08d 100644 --- a/model/command/command.py +++ b/model/command/command.py @@ -64,6 +64,8 @@ class Command: result = await plugin.plugin_instance.run(ame) else: result = await asyncio.to_thread(plugin.plugin_instance.run, ame) + if not result: + continue if isinstance(result, CommandResult): hit = result.hit res = result._result_tuple() diff --git a/type/command.py b/type/command.py index 0504f947..73ed3efe 100644 --- a/type/command.py +++ b/type/command.py @@ -18,7 +18,7 @@ class CommandResult(): 用于在Command中返回多个值 ''' - def __init__(self, hit: bool, success: bool, message_chain: list, command_name: str = "unknown_command") -> None: + def __init__(self, hit: bool, success: bool = False, message_chain: list = [], command_name: str = "unknown_command") -> None: self.hit = hit self.success = success self.message_chain = message_chain