refactor: enhance headmasterHandler to include received time in JSON responses for improved message context and consistency in message formatting
This commit is contained in:
parent
a13a33e572
commit
cd1e7cbe1c
@ -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("{\"qqid\":%d,\"nickname\":\"%s\",\"group_nickname\":\"%s\",\"referid\":%d,\"msg\":\"%s\"}", msg.UserId, msg.UserNickName, msg.GroupInfo.UserCard, msg.OriginMsgId, msg.RawMsg[7:])),
|
||||
ReplyMsg: ask(from, fmt.Sprintf("{\"qqid\":%d,\"group_nickname\":\"%s\",\"nickname\":\"%s\",\"referid\":%d,\"received_time\":%s,\"msg\":\"%s\"}", msg.UserId, msg.GroupInfo.UserCard, msg.UserNickName, msg.OriginMsgId, time.Now().Format("2006-01-02 15:04:05"), msg.RawMsg[7:])),
|
||||
ReferOriginMsg: false,
|
||||
FromMsg: msg,
|
||||
}
|
||||
}
|
||||
return model.Reply{
|
||||
ReplyMsg: ask(from, fmt.Sprintf("{\"qqid\":%d,\"nickname\":\"%s\",\"group_nickname\":\"%s\",\"referid\":%d,\"msg\":\"%s\"}", msg.UserId, msg.UserNickName, msg.GroupInfo.UserCard, msg.OriginMsgId, msg.RawMsg)),
|
||||
ReplyMsg: ask(from, fmt.Sprintf("{\"qqid\":%d,\"group_nickname\":\"%s\",\"nickname\":\"%s\",\"referid\":%d,\"received_time\":%s,\"msg\":\"%s\"}", msg.UserId, msg.GroupInfo.UserCard, msg.UserNickName, msg.OriginMsgId, time.Now().Format("2006-01-02 15:04:05"), msg.RawMsg)),
|
||||
ReferOriginMsg: false,
|
||||
FromMsg: msg,
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user