diff --git a/CHANGES/1609.misc.rst b/CHANGES/1609.misc.rst new file mode 100644 index 00000000..464f4b7e --- /dev/null +++ b/CHANGES/1609.misc.rst @@ -0,0 +1 @@ +Fixed the order of handlers in the :class:`aiogram.fsm.scene.Scene` diff --git a/aiogram/fsm/scene.py b/aiogram/fsm/scene.py index 0cbd0e8b..c8e82f03 100644 --- a/aiogram/fsm/scene.py +++ b/aiogram/fsm/scene.py @@ -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 dir(cls): + value = getattr(cls, name) if scene_handlers := getattr(value, "__aiogram_handler__", None): handlers.extend(scene_handlers) if isinstance(value, ObserverDecorator):