From 2c4dc7f818903b3715e4dafffc99a5633ee0cd3a Mon Sep 17 00:00:00 2001 From: lixiangwuxian Date: Mon, 5 May 2025 02:45:21 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=BC=98=E5=8C=96=20getMyRecentSco?= =?UTF-8?q?re=20=E5=87=BD=E6=95=B0=E4=B8=AD=E7=9A=84=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E6=9E=84=E5=BB=BA=E9=80=BB=E8=BE=91=EF=BC=8C=E5=90=88=E5=B9=B6?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E6=9E=84=E5=BB=BA=E6=AD=A5=E9=AA=A4=E4=BB=A5?= =?UTF-8?q?=E6=8F=90=E5=8D=87=E4=BB=A3=E7=A0=81=E7=AE=80=E6=B4=81=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- handler/scoresaber/score.go | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/handler/scoresaber/score.go b/handler/scoresaber/score.go index adda534..ec2299f 100644 --- a/handler/scoresaber/score.go +++ b/handler/scoresaber/score.go @@ -304,20 +304,20 @@ func getMyRecentScore(msg model.Message) (reply *model.Reply) { } //如果消息行数太多,使用合并转发 if len(records) > 5 { - var nodeMsgs []message.NodeMessage - nodeMsg := util.NewSelfNodeMessage(&message.TextMessage{ - Type: "text", - Data: message.TextMessageData{ - Text: "玩家 " + userName + " 的" + strconv.Itoa(recordCount) + "条最近记录为:\n", + nodeMsg := util.NewSelfNodeMessage(append( + []any{ + &message.TextMessage{ + Type: "text", + Data: message.TextMessageData{ + Text: "玩家 " + userName + " 的" + strconv.Itoa(recordCount) + "条最近记录为:\n", + }, + }, }, - }) - nodeMsgs = append(nodeMsgs, *nodeMsg) - for _, msg := range scoreMsg { - nodeMsgs = append(nodeMsgs, *util.NewSelfNodeMessage(msg)) - } + scoreMsg..., + )...) action.ActionManager.SendForward( &model.Reply{ - ReplyMsg: nodeMsgs, + ReplyMsg: nodeMsg, ReferOriginMsg: false, FromMsg: msg, }, @@ -327,7 +327,7 @@ func getMyRecentScore(msg model.Message) (reply *model.Reply) { return &model.Reply{ ReplyMsg: append( []any{ - &message.TextMessage{ + message.TextMessage{ Type: "text", Data: message.TextMessageData{ Text: "玩家 " + userName + " 的" + strconv.Itoa(recordCount) + "条最近记录为:",