Browse Source

fix:dingtalk channel group chat bug

master
6vision 5 months ago
parent
commit
70ff2341cb
2 changed files with 2 additions and 0 deletions
  1. +1
    -0
      channel/chat_channel.py
  2. +1
    -0
      channel/dingtalk/dingtalk_message.py

+ 1
- 0
channel/chat_channel.py View File

@@ -117,6 +117,7 @@ class ChatChannel(Channel):
logger.info("[chat_channel]receive group at") logger.info("[chat_channel]receive group at")
if not conf().get("group_at_off", False): if not conf().get("group_at_off", False):
flag = True flag = True
self.name = self.name if self.name is not None else "" # 部分渠道self.name可能没有赋值
pattern = f"@{re.escape(self.name)}(\u2005|\u0020)" pattern = f"@{re.escape(self.name)}(\u2005|\u0020)"
subtract_res = re.sub(pattern, r"", content) subtract_res = re.sub(pattern, r"", content)
if isinstance(context["msg"].at_list, list): if isinstance(context["msg"].at_list, list):


+ 1
- 0
channel/dingtalk/dingtalk_message.py View File

@@ -49,6 +49,7 @@ class DingTalkMessage(ChatMessage):
if self.is_group: if self.is_group:
self.from_user_id = event.conversation_id self.from_user_id = event.conversation_id
self.actual_user_id = event.sender_id self.actual_user_id = event.sender_id
self.is_at = True # 群聊内,只有被艾特时候才会收到消息
else: else:
self.from_user_id = event.sender_id self.from_user_id = event.sender_id
self.actual_user_id = event.sender_id self.actual_user_id = event.sender_id


Loading…
Cancel
Save