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

14
def.go
View File

@ -239,13 +239,13 @@ type JobPayloadMsgClient struct {
const ( const (
userID64ChtWrsBot = 408101137 userID64ChtWrsBot = 408101137
commandForwardMsg = 1 commandForwardMsg = 1
commandReplyMsg = 2 commandReplyMsg = 2
commandSendMsg = 3 commandSendMsg = 3
commandDeleteMsg = 4 commandDeleteMsg = 4
commandRefreshMsg = 5 commandRefreshMsg = 5
commandSendDoc = 6 commandSendDocument = 6
commandReplyDoc = 7 commandReplyDocument = 7
objTypeUser = 1 objTypeUser = 1
objTypeGuild = 2 objTypeGuild = 2

2
msg.go
View File

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