From 4d819546b06805907dc725cb0d76800142ef5e33 Mon Sep 17 00:00:00 2001 From: Soulter <37870767+Soulter@users.noreply.github.com> Date: Wed, 3 Dec 2025 13:15:12 +0800 Subject: [PATCH] fix: handle message sending in QQOfficialMessageEvent class (#3894) - Added a fallback to the `_post_send` method without parameters when the stream payload is not set, ensuring proper message handling in all scenarios. fixes: #3893 --- .../platform/sources/qqofficial/qqofficial_message_event.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/astrbot/core/platform/sources/qqofficial/qqofficial_message_event.py b/astrbot/core/platform/sources/qqofficial/qqofficial_message_event.py index fe1496644..4bc474c13 100644 --- a/astrbot/core/platform/sources/qqofficial/qqofficial_message_event.py +++ b/astrbot/core/platform/sources/qqofficial/qqofficial_message_event.py @@ -69,6 +69,8 @@ class QQOfficialMessageEvent(AstrMessageEvent): # 结束流式对话,并且传输 buffer 中剩余的消息 stream_payload["state"] = 10 ret = await self._post_send(stream=stream_payload) + else: + ret = await self._post_send() except Exception as e: logger.error(f"发送流式消息时出错: {e}", exc_info=True)