From 1af481f5f926a6e4482c2cbcadb4114046d1b938 Mon Sep 17 00:00:00 2001 From: Soulter <905617992@qq.com> Date: Thu, 7 Mar 2024 17:35:21 +0800 Subject: [PATCH] fix: function call with newer version --- model/command/command.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/model/command/command.py b/model/command/command.py index b279f1fbd..e0d509a07 100644 --- a/model/command/command.py +++ b/model/command/command.py @@ -57,7 +57,7 @@ class Command: if inspect.iscoroutinefunction(v["clsobj"].run): result = await v["clsobj"].run(ame) else: - result = asyncio.to_thread(v["clsobj"].run, ame=ame) + result = await asyncio.to_thread(v["clsobj"].run, ame) if isinstance(result, CommandResult): hit = result.hit res = result._result_tuple() @@ -74,7 +74,7 @@ class Command: if inspect.iscoroutinefunction(v["clsobj"].run): hit, res = await v["clsobj"].run(message, role, platform, message_obj, self.global_object.platform_qq) else: - hit, res = v["clsobj"].run(message, role, platform, message_obj, self.global_object.platform_qq) + hit, res = await asyncio.to_thread(v["clsobj"].run, message, role, platform, message_obj, self.global_object.platform_qq) if hit: return True, res except BaseException as e: