Skip to content

Commit

Permalink
send msg log
Browse files Browse the repository at this point in the history
  • Loading branch information
lz1998 committed Oct 19, 2020
1 parent 1eade74 commit 9e12cea
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions service/bot/api_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ func HandleSendPrivateMsg(cli *client.QQClient, req *onebot.SendPrivateMsgReq) *
miraiMsg := ProtoMsgToMiraiMsg(req.Message, req.AutoEscape)
sendingMessage := &message.SendingMessage{Elements: miraiMsg}
preProcessPrivateSendingMessage(cli, req.UserId, sendingMessage)
log.Infof("Bot(%d) Private(%d) <- %s", cli.Uin, req.UserId, MiraiMsgToRawMsg(miraiMsg))
ret := cli.SendPrivateMessage(req.UserId, sendingMessage)
cache.PrivateMessageLru.Add(ret.Id, ret)
return &onebot.SendPrivateMsgResp{
Expand All @@ -67,6 +68,7 @@ func HandleSendGroupMsg(cli *client.QQClient, req *onebot.SendGroupMsgReq) *oneb
miraiMsg := ProtoMsgToMiraiMsg(req.Message, req.AutoEscape)
sendingMessage := &message.SendingMessage{Elements: miraiMsg}
preProcessGroupSendingMessage(cli, req.GroupId, sendingMessage)
log.Infof("Bot(%d) Group(%d) <- %s", cli.Uin, req.GroupId, MiraiMsgToRawMsg(miraiMsg))
ret := cli.SendGroupMessage(req.GroupId, sendingMessage)
cache.GroupMessageLru.Add(ret.Id, ret)
return &onebot.SendGroupMsgResp{
Expand Down

0 comments on commit 9e12cea

Please sign in to comment.