This commit is contained in:
shoopea 2019-05-10 10:50:40 +08:00
parent a71e4cf696
commit bdc75004b8

6
bot.go
View File

@ -38,7 +38,7 @@ func botPhoto(m *tb.Message) {
// photos only // photos only
} }
func botHello(m *tb.Message) { func botHello(m *tb.Message) (string, error) {
fmt.Println("botHello :", m.Text) fmt.Println("botHello :", m.Text)
if !m.Private() { if !m.Private() {
fmt.Println("botHello : !m.Private()") fmt.Println("botHello : !m.Private()")
@ -46,9 +46,7 @@ func botHello(m *tb.Message) {
} }
// fmt.Println("Hello payload :", m.Payload) // <PAYLOAD> // fmt.Println("Hello payload :", m.Payload) // <PAYLOAD>
PrintText(m) PrintText(m)
m, err := b.Send(m.Sender, "hello world") return "hello world", nil
logOnError(err, "botHello")
fmt.Println("botHello : hello world")
} }
func botChannelPost(m *tb.Message) { func botChannelPost(m *tb.Message) {