-
Notifications
You must be signed in to change notification settings - Fork 69
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
Message.wait_for_click
and Client.listen
will never return the expected CallbackQuery
#31
Comments
Hello there! This issue in specific puzzled me! At first was unable to reproduce the error with either pyromod v2 or v3. I had the feeling the the problem was client.listen being unable to process the callback query. Then i realized it depends on CallbackQueryHandler to be executed and it won't execute if you don't have any callback_query handler on your code. It means that if you don't have any And i actually tested it: i tried removing all my callback_query handlers from the code and Bingo!: wait_for_click stopped working. SolutionIt will work again if you add at least one callback_query handler on your code. It does not even need to handle the CallbackQuery, it should just exist. For instance, you can add the following code into your plugins and it will make wait_for_click work as normal: @Client.on_callback_query(filters.regex('wont ever match'))
async def on_callback():
pass I don't see this as a bug by the way, it's more like a pyromod inconvenient requirement which may be improved at the future. But this totally must be documented. Thanks for reporting that! |
message.wait_for_click()
Even though clicking the button triggers the callback, it never makes him return. Unless a timeout triggers an error.Message.wait_for_click
and Client.listen
will never return the expected CallbackQuery
@usernein i'm not using any Client.on_callback_query and it still works fine |
Thanks! This solves my problem too! BTW, does the new project Hydrogram still has the wait_for_click function? |
message.wait_for_click()
Even though clicking the button triggers the callback, it never makes him return. Unless a timeout triggers an error.The same occurs in
message.chat.listen
when listener_type=ListenerTypes.CALLBACK_QUERY expects to receive a callback from the user pressing a button.I had a feeling this was an issue and wondered if it could be reproduced on your end.
thanks for the reply. 😃
The text was updated successfully, but these errors were encountered: