This commit is contained in:
shoopea 2019-05-03 11:33:06 +08:00
parent 307435a0f8
commit 108fa3332d

18
bot.go
View File

@ -20,14 +20,7 @@ func StartBot() {
return
}
b.Handle("/hello", func(m *tb.Message) {
if !m.Private() {
return
}
// fmt.Println("Hello payload :", m.Payload) // <PAYLOAD>
PrintText(m)
b.Send(m.Sender, "hello world")
})
b.Handle("/hello", botHello)
b.Handle(tb.OnPhoto, func(m *tb.Message) {
fmt.Println("OnPhoto :", m.Text)
@ -52,4 +45,13 @@ func StartBot() {
})
b.Start()
}
func botHello(m *tb.Message) {
if !m.Private() {
return
}
// fmt.Println("Hello payload :", m.Payload) // <PAYLOAD>
PrintText(m)
b.Send(m.Sender, "hello world")
}