Fixed the order of handlers in the Scene

This commit is contained in:
RootShinobi 2024-11-27 20:20:22 +02:00
parent 6520b9fba2
commit e79ab53dce
2 changed files with 3 additions and 1 deletions

1
CHANGES/1609.misc.rst Normal file
View file

@ -0,0 +1 @@
Fixed the order of handlers in the :class:`aiogram.fsm.scene.Scene`

View file

@ -323,7 +323,8 @@ class Scene:
if callback_query_without_state is None:
callback_query_without_state = parent_scene_config.callback_query_without_state
for name, value in inspect.getmembers(cls):
for name in vars(cls):
value = getattr(cls, name)
if scene_handlers := getattr(value, "__aiogram_handler__", None):
handlers.extend(scene_handlers)
if isinstance(value, ObserverDecorator):