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]))] + (