raito.plugins.scenes.steps module¶
- class raito.plugins.scenes.steps.SceneSteps(states)[исходный код]¶
Базовые классы:
objectThe ordered steps of a scene, derived from an aiogram
StatesGroup.Owns everything about the step layout — the order used by
scene.nextandscene.back, the membership checks that detect a stale scene, and the namespace prefix that tells a scene’s own states apart from anything else in FSM storage.- Параметры:
states (object)
- owns(raw_state)[исходный код]¶
Whether
raw_statelives in this scene’s namespace (current or removed).
- is_active(raw_state)[исходный код]¶
Whether
raw_stateis a step this scene still declares.
- ensure(state)[исходный код]¶
Validate that
stateis a step of this scene.- Параметры:
state (State) – state to check
- Исключение:
ValueError – if
stateis not one of the scene’s steps- Тип результата:
None
- step_for(raw_state)[исходный код]¶
Return the step matching
raw_state.Trusts that
raw_stateis already an active step of this scene — theStateFilterthat matched the handler already established that.- Параметры:
raw_state (str) – state aiogram already resolved for this update
- Результат:
the matching step
- Тип результата:
State
- after(step)[исходный код]¶
Return the step following
step(the first step, from entry).- Параметры:
step (State | None) – current step, or
Noneat entry- Результат:
next step in declaration order
- Исключение:
RuntimeError – if
stepis already the last step- Тип результата:
State
- before(step)[исходный код]¶
Return the step preceding
step.- Параметры:
step (State | None) – current step
- Результат:
previous step in declaration order
- Исключение:
RuntimeError – if there is no earlier step
- Тип результата:
State