Skip to content
/ AiogramTemplate Public template

This is a template for telegram bot on aiogram3 using asynchronous database and redis

Notifications You must be signed in to change notification settings

nazar220160/AiogramTemplate

Repository files navigation

Aiogram Template

This is a template for telegram bot on aiogram3 using asynchronous database and redis


download

git clone git@github.com:nazar220160/AiogramTemplate.git

Installation

pip install -r requirements.txt

Create db and tables. By default db is sqlite

alembic revision --autogenerate -m 'initial' && alembic upgrade head

To create locale, for example en:

pybabel init -i src/bot/common/locales/messages.pot -d src/bot/common/locales -D messages -l en

Extract text/update/compile:

Windows

pybabel extract --input-dirs=src -o src/bot/common/locales/messages.pot
pybabel update -d src/bot/common/locales -D messages -i src/bot/common/locales/messages.pot
pybabel compile -d src/bot/common/locales -D messages

Start app:

for Windows:

python -m app

for Unix:

python3 -m app

Docker

Add migrations:

docker-compose run app alembic revision --autogenerate
docker-compose run app alembic upgrade head

Windows:

docker-compose build && docker-compose run --rm migrate && docker-compose up -d

Env file

  • First of all rename your .env_example to .env and app/.env_example to app/.env

About

This is a template for telegram bot on aiogram3 using asynchronous database and redis

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages