From 1ce95c473d89913706fa2d1fbb70f8782044b1f0 Mon Sep 17 00:00:00 2001 From: shuiping233 <1944680304@qq.com> Date: Sun, 8 Jun 2025 10:19:37 +0800 Subject: [PATCH] =?UTF-8?q?fix=20:=20=E5=9C=A8stage.py=E4=B8=AD=E4=B8=93?= =?UTF-8?q?=E9=97=A8=E5=AF=B9qq=5Fofficial=E7=9A=84=E4=BC=9A=E8=AF=9D?= =?UTF-8?q?=E6=8E=A7=E5=88=B6=E5=99=A8=E6=B6=88=E6=81=AF=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- astrbot/core/pipeline/respond/stage.py | 4 ++++ .../platform/sources/qqofficial/qqofficial_message_event.py | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/astrbot/core/pipeline/respond/stage.py b/astrbot/core/pipeline/respond/stage.py index 275926ba..ad0a62c8 100644 --- a/astrbot/core/pipeline/respond/stage.py +++ b/astrbot/core/pipeline/respond/stage.py @@ -211,6 +211,10 @@ class RespondStage(Stage): logger.info( f"AstrBot -> {event.get_sender_name()}/{event.get_sender_id()}: {event._outline_chain(result.chain)}" ) + else: + # 对使用 qq_official 适配器的会话控制器发送消息的特殊处理 + if event.get_platform_name() == "qq_official": + await event._post_send() handlers = star_handlers_registry.get_handlers_by_event_type( EventType.OnAfterMessageSentEvent, platform_id=event.get_platform_id() diff --git a/astrbot/core/platform/sources/qqofficial/qqofficial_message_event.py b/astrbot/core/platform/sources/qqofficial/qqofficial_message_event.py index afb84880..d55c2671 100644 --- a/astrbot/core/platform/sources/qqofficial/qqofficial_message_event.py +++ b/astrbot/core/platform/sources/qqofficial/qqofficial_message_event.py @@ -32,7 +32,6 @@ class QQOfficialMessageEvent(AstrMessageEvent): self.send_buffer = message else: self.send_buffer.chain.extend(message.chain) - await self._post_send() async def send_streaming(self, generator, use_fallback: bool = False): """流式输出仅支持消息列表私聊"""