From 4fa9bb3c1f15c0a2a54c12ffbbb312bbb4d93126 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Sun, 15 Jun 2025 19:47:04 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=8F=92=E4=BB=B6=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E7=9A=84=E4=BA=8B=E4=BB=B6=E5=9B=9E=E8=B0=83=20[PLUGIN]?= =?UTF-8?q?=E6=8F=92=E4=BB=B6ID|=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/chain/message.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/chain/message.py b/app/chain/message.py index c26e3436..d840141a 100644 --- a/app/chain/message.py +++ b/app/chain/message.py @@ -511,13 +511,16 @@ class MessageChain(ChainBase): callback_data = text[9:] # 去掉 "CALLBACK:" 前缀 logger.info(f"处理按钮回调:{callback_data}") - # 插件消息的回调 [PLUGIN]#插件ID#内容 - if callback_data.startswith('[PLUGIN]#'): + # 插件消息的事件回调 [PLUGIN]插件ID|内容 + if callback_data.startswith('[PLUGIN]'): + # 提取插件ID和内容 + plugin_id, content = callback_data.split("|", 1) # 广播给插件处理 self.eventmanager.send_event( EventType.UserMessage, { - "text": callback_data, + "text": content, + "plugin_id": plugin_id.replace("[PLUGIN]", ""), "userid": userid, "channel": channel, "source": source,