feat: 在消息处理逻辑中添加合并转发功能,当记录条数超过 5 条时使用合并转发,提升用户体验
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"git.lxtend.com/qqbot/action"
|
||||
"git.lxtend.com/qqbot/constants"
|
||||
"git.lxtend.com/qqbot/handler"
|
||||
"git.lxtend.com/qqbot/message"
|
||||
@@ -284,6 +285,17 @@ func getMyRecentScore(msg model.Message) (reply *model.Reply) {
|
||||
FromMsg: msg,
|
||||
}
|
||||
}
|
||||
//如果消息行数太多,使用合并转发
|
||||
if recordCount > 5 {
|
||||
action.ActionManager.SendForward(
|
||||
&model.Reply{
|
||||
ReplyMsg: "玩家 " + userName + " 的" + strconv.Itoa(recordCount) + "条最近记录为:\n" + scoreMsg,
|
||||
ReferOriginMsg: true,
|
||||
FromMsg: msg,
|
||||
},
|
||||
)
|
||||
return nil
|
||||
}
|
||||
return &model.Reply{
|
||||
ReplyMsg: "玩家 " + userName + " 的" + strconv.Itoa(recordCount) + "条最近记录为:\n" + scoreMsg,
|
||||
ReferOriginMsg: true,
|
||||
|
||||
Reference in New Issue
Block a user