How to call function from callback_data that changes? #3683
-
I'm having a problem when I need to deal with InlineKeyboardButton that change its callback_data constantly. What I want is that after I select one of the buttons with the name of the games (using edit_game function), I call another function (def select_side), but how do I pass this to the CallbackQueryHandler(select_side, pattern="^" + (I DON'T KNOW WHAT PUT HERE) + "$ ") ? I've tried using loop in every possible way to create a pattern for each game but I couldn't. How can I do this? I took the inlinekeyboard2.py example and tried to implement my code from it:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The |
Beta Was this translation helpful? Give feedback.
The
pattern
argument is optional. You could just omit it.