How temirovuz/telegrambot_template_aiogram works
This repository is an Aiogram Telegram bot template. Its evidenced runtime workflow is Telegram polling through the application entry point and dispatcher, routing /start and /help to handlers that reply to users. The README also documents admin, profile, settings, registration, subscription checks, and a handler→service→database layering pattern. Those broader capabilities are represented, but their wiring is not established by the sampled source; the database lifecycle functions in main.py are placeholders.
Main entry points: services Business services · main.py Application entry · __init__.py Handler router · users.py Admin handlers
Components 19
Bot runtime
- Application entry
main.py - Configuration
core/config.py - Aiogram dispatcher
main.py - Logging setup
core/logger.py
User interactions
- Handler router
handlers/__init__.py - Start handler
handlers/common/start.py - Help handler
handlers/common/help.py
Bot capabilities
- Admin handlers
handlers/admin/users.py - Profile handler
handlers/user/profile.py - Settings handler
handlers/user/settings.py - Registration states
states/register.py - Bot keyboards
keyboards
Data and policy
- Subscription filter
filters - Admin filter
filters/is_admin.py - Business services
services - Database operations
db/crud.py - Database models
db/models.py
Other components
- Telegram user
- Telegram API
Connections 16
- Telegram user → Telegram API: sends updates
- Telegram API → Aiogram dispatcher: polls updates
- Application entry → Aiogram dispatcher: starts polling
- Application entry → Configuration: reads settings
- Application entry → Logging setup: sets up
- Aiogram dispatcher → Handler router: dispatches updates
- Handler router → Start handler: routes /start
- Handler router → Help handler: routes /help
- Start handler → Telegram API: sends reply
- Help handler → Telegram API: sends reply
- Admin handlers → Admin filter: checks admin
- Admin handlers → Business services: delegates logic
- Profile handler → Business services: delegates logic
- Settings handler → Business services: delegates logic
- Business services → Database operations: uses operations
- Database operations → Database models: uses models