telebot
telebot copied to clipboard
selector inline mode handle not listener callback button pressed
selctor inline button display success, but button pressed not handle callback. please help.
var (
selectorFirst = &tele.ReplyMarkup{}
btnPrev = selectorFirst.URL("<", "prev", "abc")
btnNext = selectorFirst.Data(">", "next", "123")
)
selectorFirst.Inline(
selectorFirst.Row(btnPrev, btnNext),
)
b.Handle(&btnNext, func(c tele.Context) error {
fmt.Println("btnNext button pressed")
return c.Respond()
// return c.Send("welcome start", selector)
})
b.Handle("/start", func(c tele.Context) error {
return c.Send("hi", selectorFirst)
})
Try
tele.Settings{
...
Poller: &tele.LongPoller{..., AllowedUpdates: []string{"message", "chat_member", "callback_query"}},
...
}
@subliker thank you for your reply, I was debugging problems with inline menu for hours.
It is very upset that AllowedUpdates doesn't mention at all in Readme
Why is it disabled by default?
Why is it disabled by default?
As far as I can tell: in other libraries(ex. aiogram), these allowed updates are automatically added when handlers are added.