telebot icon indicating copy to clipboard operation
telebot copied to clipboard

selector inline mode handle not listener callback button pressed

Open JunaYa opened this issue 1 year ago • 4 comments

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)
	})

JunaYa avatar Jun 14 '24 03:06 JunaYa

Try

tele.Settings{
		...
		Poller:  &tele.LongPoller{..., AllowedUpdates: []string{"message", "chat_member", "callback_query"}},
		...
	}

subliker avatar Nov 24 '24 17:11 subliker

@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

valner avatar Mar 02 '25 10:03 valner

Why is it disabled by default?

hdbg avatar Mar 30 '25 12:03 hdbg

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.

subliker avatar Mar 30 '25 16:03 subliker