This commit is contained in:
shoopea 2019-06-08 23:45:27 +08:00
parent 0ea4664d3f
commit 8facf6ec85
3 changed files with 11 additions and 10 deletions

5
bot.go
View File

@ -1,6 +1,7 @@
package main
import (
"bytes"
"encoding/json"
"fmt"
"log"
@ -200,10 +201,10 @@ func botMsgExportAll(m *tb.Message) {
return
}
d := &tb.Document{File: tb.FromReader(bytes.NewReader(b))}
d := tb.Document{File: tb.FromReader(bytes.NewReader(b))}
c := TGCommand{
Type: commandReplyFile,
Type: commandReplyDocument,
Document: d,
FromMsgID64: int64(m.ID),
FromChatID64: m.Chat.ID,

4
def.go
View File

@ -244,8 +244,8 @@ const (
commandSendMsg = 3
commandDeleteMsg = 4
commandRefreshMsg = 5
commandSendDoc = 6
commandReplyDoc = 7
commandSendDocument = 6
commandReplyDocument = 7
objTypeUser = 1
objTypeGuild = 2

2
msg.go
View File

@ -280,7 +280,7 @@ func zipMessages() ([]byte, error) {
m, err := getMsg(id)
logOnError(err, "zipMessages : getMsg")
if err == nil {
append(bkp.Messages, m)
append(bkp.Messages, *m)
}
}
b, err := json.Marshal(bkp)