Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from bundle
Use when building or fixing aiogram 3 bots that need aiogram_i18n with Fluent/FTL, topic-aware reply handling, Telegram quote and forward-origin context, and pr
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/callback-and-command-patterns.md
1# Callback and Command Patterns23Prefer small, typed handlers over large router files with implicit state.45## Callback queries67Recommended shape:8- typed `CallbackData`9- `@router.callback_query(MyCallback.filter(...))`10- `await callback.answer(...)` for immediate user feedback11- `edit_text(...)` or `edit_reply_markup(...)` when the callback updates the current screen12- permission filters close to the router decorator1314## Commands with reply-aware UX1516For command handlers:17- fail fast when args are missing and there is no meaningful reply18- if used as a reply, explicitly merge reply context into the prompt or action19- keep text parsing in helper functions rather than inside business logic20- keep persistence DTO construction outside the handler body when possible2122## Handler purity2324Keep handlers thin:25- parse Telegram input26- call domain or service logic27- render localized output2829Move reusable Telegram parsing rules into helpers and DTO-producing functions.30