raito.plugins.scenes.steps module

class raito.plugins.scenes.steps.SceneSteps(states)[исходный код]

Базовые классы: object

The ordered steps of a scene, derived from an aiogram StatesGroup.

Owns everything about the step layout — the order used by scene.next and scene.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_state lives in this scene’s namespace (current or removed).

Параметры:

raw_state (str)

Тип результата:

bool

is_active(raw_state)[исходный код]

Whether raw_state is a step this scene still declares.

Параметры:

raw_state (str)

Тип результата:

bool

ensure(state)[исходный код]

Validate that state is a step of this scene.

Параметры:

state (State) – state to check

Исключение:

ValueError – if state is not one of the scene’s steps

Тип результата:

None

step_for(raw_state)[исходный код]

Return the step matching raw_state.

Trusts that raw_state is already an active step of this scene — the StateFilter that 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 None at entry

Результат:

next step in declaration order

Исключение:

RuntimeError – if step is 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