/aiogram-template

Aiogram 3.x bot template using PostgreSQL (asyncpg) with SQLAlchemy + alembic.

Primary LanguagePythonMIT LicenseMIT

Aiogram Template

Deployment

  1. Setup poetry and install requirements (poetry install)
  2. Rename .env.dist to .env and configure it
  3. Run database migrations with make migrate command
  4. Before running the bot (make run), make sure you are in a virtual environment by running the command poetry shell.
  5. Optional: configure telegram-bot.service (» Read more)

Development

Update database tables structure

Make migration script:

make migration message=MESSAGE_WHAT_THE_MIGRATION_DOES

Run migrations:

make migrate

Update translations

  1. Parse new used localization keys to update translations files (make i18n locale=TRANSLATION_LOCALE)
  2. Write new translations in .ftl files by lang/TRANSLATION_LOCALE
  3. Restart the bot

Used technologies