diff --git a/plugins/maibot_adapter/main.py b/plugins/maibot_adapter/main.py index 951c760..8ff2e18 100644 --- a/plugins/maibot_adapter/main.py +++ b/plugins/maibot_adapter/main.py @@ -361,6 +361,19 @@ class MaiBotAdapterPlugin(MessagePluginInterface): "payload": payload["api_message"], } + # 发送前打印 message_info 快照: + # 1. 当前“MaiBot 侧仍显示私聊”的排障核心是确认 group_info 是否真实入包; + # 2. 仅打印 message_info,不输出 message_segment 正文,避免无意义扩大日志; + # 3. 保留 ensure_ascii=False 便于直接查看中文群名/昵称。 + try: + message_info_snapshot = json.dumps( + (payload.get("api_message") or {}).get("message_info") or {}, + ensure_ascii=False, + ) + self._log_runtime(f"[{self.name}] 发送前 message_info={message_info_snapshot}") + except Exception as exc: + self.LOG.warning(f"[{self.name}] message_info 序列化失败,跳过快照日志: {exc}") + await websocket.send_json(package) self._log_runtime( f"[{self.name}] 已发送到 MaiBot: roomid={payload['roomid']}, sender={payload['sender']}, "