refactor: 重命名Message.RawMsg

This commit is contained in:
lixiangwuxian
2024-10-13 14:40:32 +08:00
parent eed624194a
commit 1495ac516b
11 changed files with 61 additions and 38 deletions

View File

@@ -50,7 +50,7 @@ func getMySS(msg model.Message) (reply model.Reply) {
func bindSS(msg model.Message) (reply model.Reply) {
return model.Reply{
ReplyMsg: scoresaber.SSQuery.BindSS(strconv.Itoa(int(msg.UserId)), msg.Msg[len("绑定ss "):]),
ReplyMsg: scoresaber.SSQuery.BindSS(strconv.Itoa(int(msg.UserId)), msg.RawMsg[len("绑定ss "):]),
ReferOriginMsg: true,
FromMsg: msg,
}
@@ -66,9 +66,9 @@ func unbindSS(msg model.Message) (reply model.Reply) {
func getRecentScore(msg model.Message) (reply model.Reply) {
count := 1
if len(msg.Msg) > len("最热ss ") {
if len(msg.RawMsg) > len("最热ss ") {
var err error
count, err = strconv.Atoi(msg.Msg[len("最热ss "):])
count, err = strconv.Atoi(msg.RawMsg[len("最热ss "):])
if err != nil || count <= 0 {
return model.Reply{
ReplyMsg: "",
@@ -94,9 +94,9 @@ func getRecentScore(msg model.Message) (reply model.Reply) {
func getMyRecentScore(msg model.Message) (reply model.Reply) {
count := 1
scoreMsg := ""
if len(msg.Msg) > len("最新ss ") {
if len(msg.RawMsg) > len("最新ss ") {
var err error
count, err = strconv.Atoi(msg.Msg[len("最新ss "):])
count, err = strconv.Atoi(msg.RawMsg[len("最新ss "):])
if err != nil || count <= 0 {
return model.Reply{
ReplyMsg: "",