From a70386051231a8b24510647aade56401f50ec4d6 Mon Sep 17 00:00:00 2001 From: Soulter <905617992@qq.com> Date: Tue, 5 Mar 2024 13:52:44 +0800 Subject: [PATCH] fix: plugin call --- model/command/command.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/model/command/command.py b/model/command/command.py index 632adca38..b279f1fbd 100644 --- a/model/command/command.py +++ b/model/command/command.py @@ -1,6 +1,7 @@ import json import inspect import aiohttp +import asyncio import json import util.plugin_util as putil @@ -56,7 +57,7 @@ class Command: if inspect.iscoroutinefunction(v["clsobj"].run): result = await v["clsobj"].run(ame) else: - result = v["clsobj"].run(ame) + result = asyncio.to_thread(v["clsobj"].run, ame=ame) if isinstance(result, CommandResult): hit = result.hit res = result._result_tuple()