fix: 错误的回复消息类型判断

This commit is contained in:
Rock Chin
2023-01-17 21:21:35 +08:00
parent 4e54c24bf0
commit 3c96e1298c
2 changed files with 5 additions and 1 deletions

View File

@@ -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

View File

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