From 797821e2ed231db642112d1bbf57f58c674398c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=AF=BB=E6=AC=A2?= Date: Thu, 7 Mar 2024 09:48:52 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E9=80=BB=E8=BE=91=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mq/handler.go | 5 +++++ tcpserver/parse.go | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/mq/handler.go b/mq/handler.go index 3350a87d..b24a61b7 100644 --- a/mq/handler.go +++ b/mq/handler.go @@ -22,6 +22,11 @@ func parse(msg []byte) { // 记录原始数据 m.Raw = string(msg) + // 如果不是自己的消息,直接返回 + if m.FromUser == current.GetRobotInfo().WxId { + return + } + // 提取出群成员信息 // Sys类型的消息正文不包含微信 Id,所以不需要处理 if m.IsGroup() && m.Type != types.MsgTypeSys { diff --git a/tcpserver/parse.go b/tcpserver/parse.go index 981d5436..ceaacffe 100644 --- a/tcpserver/parse.go +++ b/tcpserver/parse.go @@ -23,6 +23,11 @@ func parse(remoteAddr net.Addr, msg []byte) { // 记录原始数据 m.Raw = string(msg) + // 如果不是自己的消息,直接返回 + if m.FromUser == current.GetRobotInfo().WxId { + return + } + // 提取出群成员信息 // Sys类型的消息正文不包含微信 Id,所以不需要处理 if m.IsGroup() && m.Type != types.MsgTypeSys {