From 8facf6ec850c5bec69fae6190f5f7f950c87b905 Mon Sep 17 00:00:00 2001 From: shoopea Date: Sat, 8 Jun 2019 23:45:27 +0800 Subject: [PATCH] test --- bot.go | 5 +++-- def.go | 14 +++++++------- msg.go | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/bot.go b/bot.go index db0265d..121b54b 100644 --- a/bot.go +++ b/bot.go @@ -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, diff --git a/def.go b/def.go index fe70322..a253ff0 100644 --- a/def.go +++ b/def.go @@ -239,13 +239,13 @@ type JobPayloadMsgClient struct { const ( userID64ChtWrsBot = 408101137 - commandForwardMsg = 1 - commandReplyMsg = 2 - commandSendMsg = 3 - commandDeleteMsg = 4 - commandRefreshMsg = 5 - commandSendDoc = 6 - commandReplyDoc = 7 + commandForwardMsg = 1 + commandReplyMsg = 2 + commandSendMsg = 3 + commandDeleteMsg = 4 + commandRefreshMsg = 5 + commandSendDocument = 6 + commandReplyDocument = 7 objTypeUser = 1 objTypeGuild = 2 diff --git a/msg.go b/msg.go index 6d10717..b77e04f 100644 --- a/msg.go +++ b/msg.go @@ -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)