Small refactoring

This commit is contained in:
Alex Root Junior 2023-10-13 00:00:36 +03:00
parent bda7fcd13b
commit c999964f11
No known key found for this signature in database
GPG key ID: 074C1D455EBEA4AC
3 changed files with 67 additions and 42 deletions

View file

@ -252,6 +252,7 @@ class QuizScene(Scene, state="quiz"):
quiz_router = Router(name=__name__)
# Add handler that initializes the scene
quiz_router.message.register(QuizScene.as_handler(), Command("quiz"))
quiz_router.include_scene(QuizScene)
@quiz_router.message(Command("start"))
@ -275,7 +276,7 @@ def create_dispatcher():
# ... and then register a scene in the registry
# by default, Scene will be mounted to the router that passed to the SceneRegistry,
# but you can specify the router explicitly using the `router` argument
scene_registry.add(QuizScene, router=quiz_router)
scene_registry.add(QuizScene)
return dispatcher