debug
This commit is contained in:
@@ -119,13 +119,11 @@ class GroupVirtualPlugin(MessagePluginInterface):
|
||||
|
||||
# 获取该群所在的所有虚拟聊天组
|
||||
chat_groups = self._get_chat_groups_by_group_id(roomid)
|
||||
self.LOG.debug(f"chat_groups: {chat_groups}")
|
||||
if not chat_groups:
|
||||
return False, "该群不在任何虚拟聊天组中"
|
||||
|
||||
# 生成消息唯一标识(用于防止循环转发)
|
||||
message_id = f"{full_wx_msg.msg_id}_{full_wx_msg.create_time}"
|
||||
self.LOG.debug(f"message_id: {message_id}")
|
||||
if message_id in self.message_cache:
|
||||
return False, "消息已经转发过"
|
||||
|
||||
@@ -162,6 +160,7 @@ class GroupVirtualPlugin(MessagePluginInterface):
|
||||
# 构建转发消息前缀
|
||||
prefix = f"[{sender_name}@{source_group_name}]:"
|
||||
|
||||
self.LOG.debug(f"prefix: {prefix}")
|
||||
# 根据消息类型处理
|
||||
msg_type = message.get("type", 0)
|
||||
|
||||
@@ -169,7 +168,7 @@ class GroupVirtualPlugin(MessagePluginInterface):
|
||||
if msg_type == 1:
|
||||
content = message.get("content", "")
|
||||
forward_content = f"{prefix}{content}"
|
||||
|
||||
self.LOG.debug(f"forward_content: {forward_content}")
|
||||
# 转发到其他群
|
||||
for group in chat_group["groups"]:
|
||||
if group["id"] != roomid: # 不转发回源群
|
||||
|
||||
Reference in New Issue
Block a user