Skip to content

Conversation

@jainamoswal
Copy link
Contributor

@jainamoswal jainamoswal commented Jul 7, 2024

Added the game_pattern parameter to CQH to enable callback_data-like support for filtering based on game_short_name.

It supports

  • CQH(pattern=None, game_patterm=None) handles any CQ → backward compatible
  • CQH(pattern=pattern, game_patterm=None) handles only CQs with .data→ backward compatible
  • CQH(pattern=None, game_patterm=pattern) handles only CQs with .game_short_name. → still backward compatible since game_pattern defaults to None
  • CQH(pattern=pattern, game_patterm=game_pattern) handles only CQs with matching .data xor matching .game_short_name → also backward compatible since .data and .game_short_name are mutually exclusive

This PR closes #4269.

Copy link
Member

@Bibo-Joshi Bibo-Joshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thanks for the PR! I left some comments below.

@jainamoswal jainamoswal requested a review from Bibo-Joshi July 7, 2024 14:51
Copy link
Member

@Bibo-Joshi Bibo-Joshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the new updates. the logic now lgtm - except for one comment below. please let me know when you've implemented the tests so that I can give another review :)

@jainamoswal
Copy link
Contributor Author

I have added tests here.

As a newbie can't confirm if they are accurate or need some changes.

@jainamoswal jainamoswal marked this pull request as ready for review July 10, 2024 08:56
Copy link
Member

@Bibo-Joshi Bibo-Joshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM now :) thanks for the nice contribution and your cooperation in the review process!

@Bibo-Joshi Bibo-Joshi merged commit 422993b into python-telegram-bot:master Jul 13, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jul 21, 2024
@Bibo-Joshi Bibo-Joshi added 🔌 enhancement pr description: enhancement and removed enhancement labels Nov 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

🔌 enhancement pr description: enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CallbackQueryHandler to support filtering game_short_name

2 participants