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
Wizard CB Query Handling - First Update #1896
Comments
This happens because when an update enters a wizard, it calls its parent, base scene's handler. This is ostensibly to cause const wizard = new Wizard("wizarudo", [ step0, step1 ]);
wizard.on("callback_query", ctx => ctx.reply("AHA, I ran first"));
bot.on("callback_query", ctx => ctx.scene.enter("wizarudo")); This is caused by telegraf/src/scenes/wizard/index.ts Line 61 in e5c34fa
Changing it so could also be unexpected behaviour, because when a user is in a wizard scene, any update will first run through the wizard's middleware (this is anything attached directly to the wizard) before it runs the current step. So probably a documentation issue more than a fix needed. Still, leaving this open for some time to accept comments. |
Context
This bug is related to Callback Query handling entering a Wizard Scene. When the bot enters a wizard scene the first update cached by the scene itself is the CB Query. So if there is a matching action there it will be executed.
Expected Behavior
The bot should handle the CB Query and forget it.
Current Behavior
The bot handles it twice.
Workaround
Change the CB to a different text.
The text was updated successfully, but these errors were encountered: