From f8489a4f2fe384a5be6456c50869dfcd567cc6e9 Mon Sep 17 00:00:00 2001 From: shoopea Date: Sun, 9 Jun 2019 17:24:38 +0800 Subject: [PATCH] test --- bot.go | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/bot.go b/bot.go index d150352..3c74842 100644 --- a/bot.go +++ b/bot.go @@ -268,13 +268,25 @@ func botMsgLoad(m *tb.Message) { if m.ReplyTo != nil { r := m.ReplyTo if r.Document != nil { - c := TGCommand{ - Type: commandReplyMsg, - Text: `Document found.`, - FromMsgID64: int64(m.ID), - FromChatID64: m.Chat.ID, + d := r.Document + if d.File.FilePath != nil { + txt := fmt.Sprintf("Document found at %s\n", d.File.FilePath) + c := TGCommand{ + Type: commandReplyMsg, + Text: txt, + FromMsgID64: int64(m.ID), + FromChatID64: m.Chat.ID, + } + TGCmdQueue <- c + } else { + c := TGCommand{ + Type: commandReplyMsg, + Text: `Document found but can't find local path.`, + FromMsgID64: int64(m.ID), + FromChatID64: m.Chat.ID, + } + TGCmdQueue <- c } - TGCmdQueue <- c } else { c := TGCommand{ Type: commandReplyMsg,