This commit is contained in:
shoopea 2019-06-09 22:27:20 +08:00
parent 131941eb23
commit 2bbeab7e80
2 changed files with 12 additions and 0 deletions

1
bot.go
View File

@ -278,6 +278,7 @@ func botMsgLoad(m *tb.Message) {
resp, err := http.Get(m.Payload)
logOnError(err, "botMsgLoad : Get")
defer resp.Body.Close()
buf := new(bytes.Buffer)
buf.ReadFrom(resp.Body)
err = UnzipMessages(buf.Bytes())

11
obj.go
View File

@ -110,6 +110,17 @@ func addObjMsg(msgID64 int64, msgChatID64 int64, msgUserID64 int64, msgSenderUse
if err != nil {
return 0, err
}
m := new(ChatWarsMessage)
m.ObjID64 = objId
m.UserID64 = msgUserID64
m.SenderUserID64 = msgSenderUserID64
m.Date = msgDate
m.ID64 = msgID64
m.ChatID64 = msgChatID64
m.Text = msgText
cacheObjMsg.Store(objId, *m)
return objId, nil
}