This commit is contained in:
shoopea 2019-05-26 15:57:45 +08:00
parent a7bbbfd72a
commit 41413bd3ca

6
bot.go
View File

@ -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() {