refactor: update message formatting in headmasterHandler to use JSON structure for improved data handling
This commit is contained in:
parent
a2d8fe5e79
commit
0a8ec74036
@ -33,13 +33,13 @@ func headmasterHandler(msg model.Message) (reply model.Reply) {
|
||||
}
|
||||
if len(msg.RawMsg) > 7 && msg.RawMsg[0:7] == "校长 " {
|
||||
return model.Reply{
|
||||
ReplyMsg: ask(from, fmt.Sprintf("来自%d(%s)的消息:%s", msg.UserId, msg.UserNickName, msg.RawMsg[7:])),
|
||||
ReplyMsg: ask(from, fmt.Sprintf("{\"qqid\":%d,\"nickname\":\"%s\",\"msg\":\"%s\"}", msg.UserId, msg.UserNickName, msg.RawMsg[7:])),
|
||||
ReferOriginMsg: true,
|
||||
FromMsg: msg,
|
||||
}
|
||||
}
|
||||
return model.Reply{
|
||||
ReplyMsg: ask(from, fmt.Sprintf("来自%d(%s)的消息:%s", msg.UserId, msg.UserNickName, msg.RawMsg)),
|
||||
ReplyMsg: ask(from, fmt.Sprintf("{\"qqid\":%d,\"nickname\":\"%s\",\"msg\":\"%s\"}", msg.UserId, msg.UserNickName, msg.RawMsg)),
|
||||
ReferOriginMsg: true,
|
||||
FromMsg: msg,
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user