From 41413bd3caffda031214231554e8f1ed0fa499fd Mon Sep 17 00:00:00 2001 From: shoopea Date: Sun, 26 May 2019 15:57:45 +0800 Subject: [PATCH] test --- bot.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bot.go b/bot.go index 1d49687..8503d4c 100644 --- a/bot.go +++ b/bot.go @@ -32,6 +32,7 @@ func BotHandlers(b *tb.Bot) { b.Handle(tb.OnChannelPost, botChannelPost) b.Handle(tb.OnQuery, botQuery) b.Handle(tb.OnText, botText) + b.Handle(tb.OnDocument, botDocument) b.Start() } @@ -41,6 +42,11 @@ func botPhoto(m *tb.Message) { // photos only } +func botDocument(m *tb.Message) { + fmt.Printf("botDocument : %s (%d - %s)", m.Document.FileName, m.Document.File.FileSize, m.Document.File.FilePath) + // documents only +} + func botHello(m *tb.Message) (string, error) { fmt.Println("botHello :", m.Text) if !m.Private() {