diff --git a/channel/chat_channel.py b/channel/chat_channel.py index 6e2a45c..27f3af0 100644 --- a/channel/chat_channel.py +++ b/channel/chat_channel.py @@ -117,6 +117,7 @@ class ChatChannel(Channel): logger.info("[chat_channel]receive group at") if not conf().get("group_at_off", False): flag = True + self.name = self.name if self.name is not None else "" # 部分渠道self.name可能没有赋值 pattern = f"@{re.escape(self.name)}(\u2005|\u0020)" subtract_res = re.sub(pattern, r"", content) if isinstance(context["msg"].at_list, list): diff --git a/channel/dingtalk/dingtalk_message.py b/channel/dingtalk/dingtalk_message.py index 1bba85d..7806907 100644 --- a/channel/dingtalk/dingtalk_message.py +++ b/channel/dingtalk/dingtalk_message.py @@ -49,6 +49,7 @@ class DingTalkMessage(ChatMessage): if self.is_group: self.from_user_id = event.conversation_id self.actual_user_id = event.sender_id + self.is_at = True # 群聊内,只有被艾特时候才会收到消息 else: self.from_user_id = event.sender_id self.actual_user_id = event.sender_id