The problem is that my bot needs to send a list of buttons that change this list when one of them is clicked. Long story short, it's a list of subscriptions that can be toggled. I think it's necessary to say that list of available resources is retrieved from a database, so it's always different, I can't prepare set of buttons for this.
On top of that, if the bot is stopped, all old buttons are not responsible because these buttons were added in runtime.
That being said, I quickly examined source code of this library and came up with this:
// I do this before the bot starts, so this
// handler is able to answer to old messages
bot.Handle("\f<unique>", handler)
I found out that when checking against callback query unique, it prefixes this unique with \f and then checks against the list of bot's handlers.
So, is there a better way? If there's not, can I do a PR with some new function like HandleCallbackButton(unique, callback) that will prefix unique with \f?
Also I want to say thank you for your work, it's really awesome and easy to use library!
Can you just define a base button with Unique field set? Then you just have to register it once as usual, and create temporal buttons based on database data with the same Unique value. I think it works nicely
The problem is that my bot needs to send a list of buttons that change this list when one of them is clicked. Long story short, it's a list of subscriptions that can be toggled. I think it's necessary to say that list of available resources is retrieved from a database, so it's always different, I can't prepare set of buttons for this.
On top of that, if the bot is stopped, all old buttons are not responsible because these buttons were added in runtime.
That being said, I quickly examined source code of this library and came up with this:
I found out that when checking against callback query unique, it prefixes this unique with
\f
and then checks against the list of bot's handlers.So, is there a better way? If there's not, can I do a PR with some new function like
HandleCallbackButton(unique, callback)
that will prefixunique
with\f
?Also I want to say thank you for your work, it's really awesome and easy to use library!