From 697f5560a48215b6ebaf28d9ca887b2c63171d65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=AF=BB=E6=AC=A2?= Date: Fri, 3 Nov 2023 11:48:51 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E8=AF=AD=E6=B3=95=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- handler/parse.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/handler/parse.go b/handler/parse.go index b6f653d..46c0bad 100644 --- a/handler/parse.go +++ b/handler/parse.go @@ -26,8 +26,13 @@ func Parse(remoteAddr net.Addr, msg []byte) { groupUser := "" msgStr := m.Content if strings.Contains(m.FromUser, "@") { - // 系统消息不单独处理 - if m.Type != types.MsgTypeRecalled && m.Type != types.MsgTypeSys { + switch m.Type { + case types.MsgTypeRecalled: + // 消息撤回 + case types.MsgTypeSys: + // 系统消息 + default: + // 默认消息处理 groupUser = strings.Split(m.Content, "\n")[0] groupUser = strings.ReplaceAll(groupUser, ":", "")