Added possibility to reset context on scene entered and to handle callback query in any state

This commit is contained in:
Alex Root Junior 2023-09-03 03:12:01 +03:00
parent ba3490363f
commit e443e58daf
No known key found for this signature in database
GPG key ID: 074C1D455EBEA4AC
2 changed files with 35 additions and 7 deletions

View file

@ -137,7 +137,12 @@ class NameScene(CancellableScene, state="name"):
await self.wizard.update_data(name=message.text)
class DefaultScene(Scene):
class DefaultScene(
Scene,
reset_data_on_enter=True, # Reset state data
reset_history_on_enter=True, # Reset history
callback_query_without_state=True, # Handle callback queries even if user in any scene
):
"""
Default scene for the bot.