From 3c96e1298c16464f9076714ba00d33920cd230ff Mon Sep 17 00:00:00 2001 From: Rock Chin <1010553892@qq.com> Date: Tue, 17 Jan 2023 21:21:35 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=94=99=E8=AF=AF=E7=9A=84=E5=9B=9E?= =?UTF-8?q?=E5=A4=8D=E6=B6=88=E6=81=AF=E7=B1=BB=E5=9E=8B=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/plugin/host.py | 3 +++ pkg/qqbot/process.py | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/plugin/host.py b/pkg/plugin/host.py index 45af559d..441fe315 100644 --- a/pkg/plugin/host.py +++ b/pkg/plugin/host.py @@ -273,4 +273,7 @@ class PluginHost: logging.error("插件{}触发事件{}时发生错误".format(plugin['name'], event_name)) logging.error(traceback.format_exc()) + logging.debug("事件 {} ({}) 处理完毕,返回值: {}".format(event_name, event_context.eid, + event_context.__return_value__)) + return event_context diff --git a/pkg/qqbot/process.py b/pkg/qqbot/process.py index 42f8faed..df3094ff 100644 --- a/pkg/qqbot/process.py +++ b/pkg/qqbot/process.py @@ -1,6 +1,7 @@ # 此模块提供了消息处理的具体逻辑的接口 import asyncio +import mirai from func_timeout import func_set_timeout import logging @@ -114,7 +115,7 @@ def process_message(launcher_type: str, launcher_id: int, text_message: str, mes reply = pkg.qqbot.message.process_normal_message(text_message, mgr, config, launcher_type, launcher_id, sender_id) - if reply is not None and type(reply[0]) == str: + if reply is not None and (type(reply[0]) == str or type(reply[0]) == mirai.Plain): logging.info( "回复[{}]文字消息:{}".format(session_name, reply[0][:min(100, len(reply[0]))] + (