From f1599e26b32ea3bc7c32a8ee8d592274ebad8657 Mon Sep 17 00:00:00 2001 From: Soulter <905617992@qq.com> Date: Thu, 16 Jan 2025 11:19:02 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20webchat=20=E4=B8=BB=E5=8A=A8=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- astrbot/core/platform/sources/webchat/webchat_adapter.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/astrbot/core/platform/sources/webchat/webchat_adapter.py b/astrbot/core/platform/sources/webchat/webchat_adapter.py index e2a438caf..63da1d6f4 100644 --- a/astrbot/core/platform/sources/webchat/webchat_adapter.py +++ b/astrbot/core/platform/sources/webchat/webchat_adapter.py @@ -38,11 +38,13 @@ class WebChatAdapter(Platform): ) async def send_by_session(self, session: MessageSesion, message_chain: MessageChain): + # abm.session_id = f"webchat!{username}!{cid}" plain = "" + cid = session.session_id.split("!")[-1] for comp in message_chain.chain: if isinstance(comp, Plain): plain += comp.text - web_chat_back_queue.put_nowait(plain) + web_chat_back_queue.put_nowait((plain, cid)) await super().send_by_session(session, message_chain)