telebot
telebot copied to clipboard
proposal: bot: identify the button by its callback
When you are putting a handler for an inline button, all you get in the callback is a reference to a callback object
func handler(c *tb.Callback) {
...
}
but there is no way to identify which inline button this callback was made from. This prevents a developer from creating a handler middleware for inline buttons aggregation as there is no easy way to find the button that was pressed, as you just assume that every button has its own handler.
Something that would be great to have is
func handler(button *tb.InlineButton, c *tb.Callback) {
...
}
or for the callback to have any button-related information. Even the unique id that is used in creation of an inline button would be very handy.
A good package anyways, Thanks
It's real with the context-based routing I described here. Marked it as a feature, seems quite helpful.