Skip to content

JiuwenSwarm is an intelligent AI Agent built on openJiuwen. It extends the powerful capabilities of large language models directly to your fingertips through various communication apps you use daily.

Python

fix: 解决多飞书bot时消息id冲突

yukuanj67d45084eea2
diff --git a/jiuwenclaw/channel/feishu.py b/jiuwenclaw/channel/feishu.py
index 41ce408344..0730575fad 100644
--- a/jiuwenclaw/channel/feishu.py
+++ b/jiuwenclaw/channel/feishu.py
@@ -169,8 +169,10 @@ class FeishuChannel(BaseChannel):
Args:
inbound: Feishu 入站消息
"""
+ # Message 的 id 必须全局唯一;多 bot 同群时飞书消息 message_id 相同,需加上 channel_id 防止冲突。
+ msg_id = f"{self.channel_id}:{inbound.message_id}"
msg = Message(
- id=inbound.message_id,
+ id=msg_id,
type="req",
channel_id=self.channel_id,
session_id=str(inbound.chat_id),