diff --git a/handler/beatleader/beatleader.go b/handler/beatleader/beatleader.go index 1730a45..9b28794 100644 --- a/handler/beatleader/beatleader.go +++ b/handler/beatleader/beatleader.go @@ -287,10 +287,28 @@ func getMyRecentScore(msg model.Message) (reply *model.Reply) { } //如果消息行数太多,使用合并转发 if recordCount > 5 { + textMsg := message.TextMessage{ + Type: "text", + Data: message.TextMessageData{ + Text: "玩家 " + userName + " 的" + strconv.Itoa(recordCount) + "条最近记录为:\n" + scoreMsg, + }, + } + nodeMsg := message.NewNodeMessage() + loginAccountInfo, err := action.GetLoginAccountInfo() + if err != nil { + log.Println("GetLoginAccountInfo error:", err) + return nil + } + if loginAccountInfo == nil { + return nil + } + nodeMsg.Data.UserID = strconv.FormatInt(int64(loginAccountInfo.Data.UserID), 10) + nodeMsg.Data.Nickname = loginAccountInfo.Data.Nickname + nodeMsg.Data.Content = []any{&textMsg} action.ActionManager.SendForward( &model.Reply{ - ReplyMsg: "玩家 " + userName + " 的" + strconv.Itoa(recordCount) + "条最近记录为:\n" + scoreMsg, - ReferOriginMsg: true, + ReplyMsg: []any{&nodeMsg}, + ReferOriginMsg: false, FromMsg: msg, }, ) diff --git a/handler/scoresaber/score.go b/handler/scoresaber/score.go index 2989283..deb24cd 100644 --- a/handler/scoresaber/score.go +++ b/handler/scoresaber/score.go @@ -300,10 +300,28 @@ func getMyRecentScore(msg model.Message) (reply *model.Reply) { } //如果消息行数太多,使用合并转发 if recordCount > 5 { + textMsg := message.TextMessage{ + Type: "text", + Data: message.TextMessageData{ + Text: "玩家 " + userName + " 的" + strconv.Itoa(recordCount) + "条最近记录为:\n" + scoreMsg, + }, + } + nodeMsg := message.NewNodeMessage() + loginAccountInfo, err := action.GetLoginAccountInfo() + if err != nil { + log.Println("GetLoginAccountInfo error:", err) + return nil + } + if loginAccountInfo == nil { + return nil + } + nodeMsg.Data.UserID = strconv.FormatInt(int64(loginAccountInfo.Data.UserID), 10) + nodeMsg.Data.Nickname = loginAccountInfo.Data.Nickname + nodeMsg.Data.Content = []any{&textMsg} action.ActionManager.SendForward( &model.Reply{ - ReplyMsg: "玩家 " + userName + " 的" + strconv.Itoa(recordCount) + "条最近记录为:\n" + scoreMsg, - ReferOriginMsg: true, + ReplyMsg: []any{&nodeMsg}, + ReferOriginMsg: false, FromMsg: msg, }, )