Flags
Table of Contents
Classes
- Flag
- Per-handler metadata tag, mirror of upstream `aiogram.dispatcher.flags.Flag`
(`@dataclass(frozen=True)`). Two roles:
- FlagDecorator
- Imperative attachment seam for flags. Mirrors the runtime half of
`aiogram.dispatcher.flags.FlagDecorator.__call__` — the branch that mutates
the callback by setting `value.aiogram_flag = {...}`.
- FlagGenerator
- Sugary factory mirror of upstream's module-level `from aiogram import flags`
singleton. The Python original supports `flags.admin_only` (attribute access
with no parens), `flags.throttle(5)` (callable returning a decorator with a
value), and `flags.chat_action(action='typing')` (keyword form). PHP can't
make attribute access return a configurable value, so we collapse all three
into a single magic-static call form: `FlagGenerator::<name>(?$value)`.
- Flags
- Read flags from a target, combining both attachment styles: