This commit is contained in:
shoopea 2019-06-09 17:44:19 +08:00
parent 45b1dc51c5
commit 85fa235399

15
bot.go
View File

@ -269,11 +269,18 @@ func botMsgLoad(m *tb.Message) {
r := m.ReplyTo r := m.ReplyTo
if r.Document != nil { if r.Document != nil {
d := r.Document d := r.Document
if len(d.File.FilePath) > 0 { if d.File.OnDisk() {
txt := fmt.Sprintf("Document found at %s\n", d.File.FilePath)
c := TGCommand{ c := TGCommand{
Type: commandReplyMsg, Type: commandReplyMsg,
Text: txt, Text: "File on disk !",
FromMsgID64: int64(m.ID),
FromChatID64: m.Chat.ID,
}
TGCmdQueue <- c
} else if d.File.InCloud() {
c := TGCommand{
Type: commandReplyMsg,
Text: "File in cloud !",
FromMsgID64: int64(m.ID), FromMsgID64: int64(m.ID),
FromChatID64: m.Chat.ID, FromChatID64: m.Chat.ID,
} }
@ -281,7 +288,7 @@ func botMsgLoad(m *tb.Message) {
} else { } else {
c := TGCommand{ c := TGCommand{
Type: commandReplyMsg, Type: commandReplyMsg,
Text: `Document found but can't find local path.`, Text: `Document found but can't find file.`,
FromMsgID64: int64(m.ID), FromMsgID64: int64(m.ID),
FromChatID64: m.Chat.ID, FromChatID64: m.Chat.ID,
} }