fix(bot): 修复adapter_response被echo检查拦截的严重bug
问题: - Napcat发送adapter_response时同时设置了echo=True - 原逻辑先检查echo,导致adapter_response消息被提前return - Maizone获取Cookie等功能完全失效(超时40秒) 修复: - 将adapter_response检查移到echo检查之前 - 确保adapter_response消息优先处理 - 移除重复的adapter_response检查逻辑 影响: - Maizone插件现在可以正确获取QQ空间Cookie - 所有adapter命令响应都能正常工作 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -363,6 +363,14 @@ class ChatBot:
|
||||
# print(message_data)
|
||||
# logger.debug(str(message_data))
|
||||
|
||||
# 优先处理adapter_response消息(在echo检查之前!)
|
||||
message_segment = message_data.get("message_segment")
|
||||
if message_segment and isinstance(message_segment, dict):
|
||||
if message_segment.get("type") == "adapter_response":
|
||||
logger.info(f"[DEBUG bot.py message_process] 检测到adapter_response,立即处理")
|
||||
await self._handle_adapter_response_from_dict(message_segment.get("data"))
|
||||
return
|
||||
|
||||
# 先提取基础信息检查是否是自身消息上报
|
||||
from maim_message import BaseMessageInfo
|
||||
temp_message_info = BaseMessageInfo.from_dict(message_data.get("message_info", {}))
|
||||
@@ -373,14 +381,7 @@ class ChatBot:
|
||||
await MessageStorage.update_message(message_data)
|
||||
return
|
||||
|
||||
# 优先处理adapter_response消息(在创建DatabaseMessages之前)
|
||||
message_segment = message_data.get("message_segment")
|
||||
if message_segment and isinstance(message_segment, dict):
|
||||
if message_segment.get("type") == "adapter_response":
|
||||
logger.info(f"[DEBUG bot.py message_process] 检测到adapter_response,立即处理")
|
||||
await self._handle_adapter_response_from_dict(message_segment.get("data"))
|
||||
return
|
||||
|
||||
group_info = temp_message_info.group_info
|
||||
user_info = temp_message_info.user_info
|
||||
|
||||
|
||||
Reference in New Issue
Block a user