OnChannelPost
extends OnAttribute
in package
Marks a scene method as a handler for `channel_post` events.
Mirrors on.channel_post from OnMarker (aiogram/fsm/scene.py:977).
Attributes
- #[Attribute]
- \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE
Table of Contents
Properties
- $action : SceneAction|null
- Optional lifecycle action filter.
- $after : After|null
- Optional post-handler action.
- $event : string
- The Telegram observer name this attribute targets (e.g. `'message'`, `'callback_query'`). Set by subclass constructors.
- $filters : array<int, Filter>
- Optional dispatcher filters that must pass before this handler fires.
Methods
- __construct() : mixed
Properties
$action
Optional lifecycle action filter.
public
SceneAction|null
$action
null— the handler runs for any event of this type while in scene.SceneAction::Enter— runs when entering the scene via this event.SceneAction::Leave— runs when leaving the scene via this event.SceneAction::Exit— runs when exiting FSM via this event.SceneAction::Back— runs when rolling back via this event.
$after
Optional post-handler action.
public
After|null
$after
When non-null, the framework will execute this action (exit / back /
goto) automatically after the handler method returns, saving the user
from having to call $this->wizard->exit() etc. manually.
Mirrors the after= parameter on ObserverDecorator
(aiogram/fsm/scene.py:113).
$event
The Telegram observer name this attribute targets (e.g. `'message'`, `'callback_query'`). Set by subclass constructors.
public
string
$event
$filters
Optional dispatcher filters that must pass before this handler fires.
public
array<int, Filter>
$filters
Mirrors the *filters positional args on ObserverMarker.__call__
(aiogram/fsm/scene.py:939-944).
Methods
__construct()
public
__construct([SceneAction|null $action = null ][, After|null $after = null ], Filter ...$filters) : mixed
Parameters
- $action : SceneAction|null = null
-
Lifecycle action filter.
- $after : After|null = null
-
Post-handler action.
- $filters : Filter
-
Additional dispatcher filters.