Skip to content

ightingale/aiogram_bot_template

Repository files navigation

Aiogram Template Bot

Description

Telegram bot based on a template from wakaree with using dishka and aiogram_dialog

System dependencies

  • Python 3.12+
  • Docker
  • docker-compose
  • make
  • poetry

Deployment

Via Docker

  • Rename .env.dist to .env and configure it
  • Rename docker-compose.example.yml to docker-compose.yml
  • Run make app-build command then make app-run to start the bot

Via Systemd service

  • Configure and start PostgreSQL
  • Configure and start Redis (» Read more)
  • Rename .env.example to .env and configure it
  • Run database migrations with make migrate command
  • Configure telegram-bot.service (» Read more)

Development

Setup environment

poetry install

Update database tables structure

Make migration script:

make migration message=MESSAGE_WHAT_THE_MIGRATION_DOES

Run migrations:

make migrate

Used technologies:

  • Aiogram 3.x (Telegram bot framework)
  • PostgreSQL (database)
  • SQLAlchemy (working with database from Python)
  • Alembic (lightweight database migration tool)
  • Redis (in-memory data storage for FSM and caching)
  • Dishka (DI framework with scopes and agreeable API)
  • aiogram_dialog (framework for developing interactive messages and menus in your telegram bot like a normal GUI application.)

About

Telegram Bot Template

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published