-
Notifications
You must be signed in to change notification settings - Fork 5.7k
CallbackQueryHandler to support filtering game_short_name #4269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi I rewrote it a bit to make it more clear its about providing filtering, as you wrote in the end of the issue, a handler without a pattern set handles that update just fine. I am fine with adding a filter attribute for that in the same function as pattern, I don't think changing the behavior of the argument as you describe is the best way, I would rather see a new argument introduced. |
Hey.
@Pooolitzer I guess you mean an interface like
I vote +0 on this, i.e. I welcome a PR, but don't see a need for the PTB dev team to work on this actively |
Hey @Bibo-Joshi, I would like to create a PR for this. |
Uh oh!
There was an error while loading. Please reload this page.
What kind of feature are you missing? Where do you notice a shortcoming of PTB?
Currently, the CallbackQueryHandler in the library only checks the .data attribute when handling callback queries (ref). This presents a limitation as it doesn't support regex filtering handling clicks on buttons associated with CallbackGame. When a user clicks on a CallbackGame button, the .data attribute is None, causing the CallbackQueryHandler's regex pattern match to fail if it is set.
Describe the solution you'd like
I think changing this line to
would solve this limitation.
Describe alternatives you've considered
Currently I manage to overcome this by handling all callbacks in one handler without pattern match and then using if else with
.game_short_name
attributeAdditional context
No response
The text was updated successfully, but these errors were encountered: