refactor: modify headmasterHandler to include message origin ID in JSON response and adjust ReferOriginMsg flag for improved message tracking
This commit is contained in:
parent
0a8ec74036
commit
d3e9c9b0d6
@ -33,14 +33,14 @@ 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("{\"qqid\":%d,\"nickname\":\"%s\",\"msg\":\"%s\"}", msg.UserId, msg.UserNickName, msg.RawMsg[7:])),
|
||||
ReferOriginMsg: true,
|
||||
ReplyMsg: ask(from, fmt.Sprintf("{\"qqid\":%d,\"nickname\":\"%s\",\"referid\":%d,\"msg\":\"%s\"}", msg.UserId, msg.UserNickName, msg.OriginMsgId, msg.RawMsg[7:])),
|
||||
ReferOriginMsg: false,
|
||||
FromMsg: msg,
|
||||
}
|
||||
}
|
||||
return model.Reply{
|
||||
ReplyMsg: ask(from, fmt.Sprintf("{\"qqid\":%d,\"nickname\":\"%s\",\"msg\":\"%s\"}", msg.UserId, msg.UserNickName, msg.RawMsg)),
|
||||
ReferOriginMsg: true,
|
||||
ReplyMsg: ask(from, fmt.Sprintf("{\"qqid\":%d,\"nickname\":\"%s\",\"referid\":%d,\"msg\":\"%s\"}", msg.UserId, msg.UserNickName, msg.OriginMsgId, msg.RawMsg)),
|
||||
ReferOriginMsg: false,
|
||||
FromMsg: msg,
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user