From ff01126ed1fb9b7461f19e51b746e550561d1382 Mon Sep 17 00:00:00 2001 From: Redmomn <109732988+Redmomn@users.noreply.github.com> Date: Sun, 6 Oct 2024 22:56:16 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9B=B4=E6=96=B0=E4=B8=8A=E6=B8=B8?= =?UTF-8?q?=EF=BC=8C=E4=BC=98=E5=8C=96=E8=8E=B7=E5=8F=96=E7=BE=A4=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- coolq/api.go | 13 ++++++------- go.mod | 2 +- go.sum | 9 ++------- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/coolq/api.go b/coolq/api.go index e0ce917f5..61a8ab88f 100644 --- a/coolq/api.go +++ b/coolq/api.go @@ -838,33 +838,32 @@ func (bot *CQBot) CQProcessGroupRequest(flag, subType, reason string, approve bo log.Warnf("获取群系统消息失败: %v", err) return Failed(100, "SYSTEM_MSG_API_ERROR", err.Error()) } - msgs = append(msgs, filteredmsgs...) if subType == "add" { - for _, req := range msgs { + for _, req := range append(msgs.JoinRequests, filteredmsgs.JoinRequests...) { if strconv.FormatInt(int64(req.Sequence), 10) == flag { if req.Checked() { log.Warnf("处理群系统消息失败: 无法操作已处理的消息.") return Failed(100, "FLAG_HAS_BEEN_CHECKED", "消息已被处理") } if approve { - _ = bot.Client.SetGroupRequest(req.IsFiltered, true, req.Sequence, req.EventType, req.GroupUin, "") + _ = bot.Client.SetGroupRequest(req.IsFiltered, true, req.Sequence, uint32(req.EventType), req.GroupUin, "") } else { - _ = bot.Client.SetGroupRequest(req.IsFiltered, false, req.Sequence, req.EventType, req.GroupUin, reason) + _ = bot.Client.SetGroupRequest(req.IsFiltered, false, req.Sequence, uint32(req.EventType), req.GroupUin, reason) } return OK(nil) } } } else { - for _, req := range msgs { + for _, req := range append(msgs.InvitedRequests, filteredmsgs.InvitedRequests...) { if strconv.FormatInt(int64(req.Sequence), 10) == flag { if req.Checked() { log.Warnf("处理群系统消息失败: 无法操作已处理的消息.") return Failed(100, "FLAG_HAS_BEEN_CHECKED", "消息已被处理") } if approve { - _ = bot.Client.SetGroupRequest(req.IsFiltered, true, req.Sequence, req.EventType, req.GroupUin, "") + _ = bot.Client.SetGroupRequest(req.IsFiltered, true, req.Sequence, uint32(req.EventType), req.GroupUin, "") } else { - _ = bot.Client.SetGroupRequest(req.IsFiltered, false, req.Sequence, req.EventType, req.GroupUin, reason) + _ = bot.Client.SetGroupRequest(req.IsFiltered, false, req.Sequence, uint32(req.EventType), req.GroupUin, reason) } return OK(nil) } diff --git a/go.mod b/go.mod index 01fb4b076..b11fb0852 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( github.com/FloatTech/sqlite v1.6.3 - github.com/LagrangeDev/LagrangeGo v0.0.0-20241005142805-27377f34691c + github.com/LagrangeDev/LagrangeGo v0.0.0-20241006144137-4fc7fcb8caa1 github.com/Microsoft/go-winio v0.6.2-0.20230724192519-b29bbd58a65a github.com/RomiChan/syncx v0.0.0-20240418144900-b7402ffdebc7 github.com/RomiChan/websocket v1.4.3-0.20220227141055-9b2c6168c9c5 diff --git a/go.sum b/go.sum index 2b29b66b0..27226fd65 100644 --- a/go.sum +++ b/go.sum @@ -2,12 +2,8 @@ github.com/FloatTech/sqlite v1.6.3 h1:MQkqBNlkPuCoKQQgoNLuTL/2Ci3tBTFAnVYBdD0Wy4 github.com/FloatTech/sqlite v1.6.3/go.mod h1:zFbHzRfB+CJ+VidfjuVbrcin3DAz283F7hF1hIeHzpY= github.com/FloatTech/ttl v0.0.0-20230307105452-d6f7b2b647d1 h1:g4pTnDJUW4VbJ9NvoRfUvdjDrHz/6QhfN/LoIIpICbo= github.com/FloatTech/ttl v0.0.0-20230307105452-d6f7b2b647d1/go.mod h1:fHZFWGquNXuHttu9dUYoKuNbm3dzLETnIOnm1muSfDs= -github.com/LagrangeDev/LagrangeGo v0.0.0-20241005062358-5cefea3b3cf7 h1:0U/Vw6qQHv4SAInJNsNWdH2FL/1FiFsIDmjQkmQI+Lk= -github.com/LagrangeDev/LagrangeGo v0.0.0-20241005062358-5cefea3b3cf7/go.mod h1:qK/l75YuMYdJWfPcxPhfjybJdXD4kzMFvcbKlvdAoa0= -github.com/LagrangeDev/LagrangeGo v0.0.0-20241005082947-c1dd41dacc5d h1:OTtMJj2DPkkuqO52EuxCqjjmmko5lgX6ZUeWvyTUcCc= -github.com/LagrangeDev/LagrangeGo v0.0.0-20241005082947-c1dd41dacc5d/go.mod h1:qK/l75YuMYdJWfPcxPhfjybJdXD4kzMFvcbKlvdAoa0= -github.com/LagrangeDev/LagrangeGo v0.0.0-20241005142805-27377f34691c h1:rbzkFsatoMBr4UVOfWqM+0NuSjG6HaRrrDeidaRYD64= -github.com/LagrangeDev/LagrangeGo v0.0.0-20241005142805-27377f34691c/go.mod h1:qK/l75YuMYdJWfPcxPhfjybJdXD4kzMFvcbKlvdAoa0= +github.com/LagrangeDev/LagrangeGo v0.0.0-20241006144137-4fc7fcb8caa1 h1:qbUK72LzMKXiAHaRVVfpJLxS5eQwQsYKyrHarOp7OQM= +github.com/LagrangeDev/LagrangeGo v0.0.0-20241006144137-4fc7fcb8caa1/go.mod h1:qK/l75YuMYdJWfPcxPhfjybJdXD4kzMFvcbKlvdAoa0= github.com/Microsoft/go-winio v0.6.2-0.20230724192519-b29bbd58a65a h1:aU1703IHxupjzipvhu16qYKLMR03e+8WuNR+JMsKfGU= github.com/Microsoft/go-winio v0.6.2-0.20230724192519-b29bbd58a65a/go.mod h1:OZqLNXdYJHmx7aqq/T6wAdFEdoGm5nmIfC4kU7M8P8o= github.com/RomiChan/protobuf v0.1.1-0.20230204044148-2ed269a2e54d h1:/Xuj3fIiMY2ls1TwvPKmaqQrtJsPY+c9s+0lOScVHd8= @@ -162,7 +158,6 @@ golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJ golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.ilharper.com/x/isatty v1.1.1 h1:RAg32Pxq/nIK4AVtdm9RBqxsxZZX1uRKRSS21E5SHMk= gopkg.ilharper.com/x/isatty v1.1.1/go.mod h1:ofpv77Td5qQO6R1dmDd3oNt8TZdRo+l5gYAMxopRyS0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=