This commit is contained in:
shoopea 2019-05-10 10:43:54 +08:00
parent 6ac4a78e0d
commit 7c13208cc1

14
bot.go
View File

@ -20,7 +20,19 @@ func StartBot() {
failOnError(err, "StartBot") failOnError(err, "StartBot")
b.Handle("/hello", botHello) b.Handle("/hello", func(m *tb.Message) {
fmt.Println("botHello :", m.Text)
if !m.Private() {
fmt.Println("botHello : !m.Private()")
return
}
// fmt.Println("Hello payload :", m.Payload) // <PAYLOAD>
PrintText(m)
m, err := b.Send(m.Sender, "hello world")
logOnError(err, "botHello")
fmt.Println("botHello : hello world")
})
b.Handle("/rescan_msg", botRescanMsg) b.Handle("/rescan_msg", botRescanMsg)
b.Handle(tb.OnPhoto, botPhoto) b.Handle(tb.OnPhoto, botPhoto)
b.Handle(tb.OnChannelPost, botChannelPost) b.Handle(tb.OnChannelPost, botChannelPost)