This project is frozen because I found the cookiecutter quite complicated. Please use another, not yet frozen template for bots on aiogram - https://github.com/gabbhack/base-bot
-
Based on Aiogram 3.x - modern Telegram Bot API framework.
-
Docker integration.
-
Docker Compose for local development.
-
EdgeDB with migrations.
-
Internationalization via
Babel
and aiogram's built-in i18n middlewares.
pip install cookiecutter
cookiecutter https://github.com/gabbhack/skelet-bot
Input variables
-
python_major_version
: The Python major version. Default:3
. -
python_minor_version
: The Python minor version. Default:10
. -
project_name
: The name of the project. -
project_slug
: The development friendly name of the project. By default, based on the project name. -
author
: The author of the project. -
author_email
: The email of author. -
description
: The description of the project. -
license
: The license of the project. -
repository
: The repository of the project. -
setup_json_logger
: Setup python-json-logger. Default:yes
. -
use_pytest
: Install pytest, createtests
directory, add shortcuts to theMakefile
. Default:yes
. -
use_orjson
: Install orjson and setup it in the bot client. Default:yes
. -
use_i18n
: Installi18n
stuff and add shortcuts to theMakefile
. Default:yes
. -
i18n_dir
: Setupi18n
directory. Ignored if you do not use i18n. Default:locales
. -
i18n_domain
: Setupi18n
domain. Ignored if you do not use i18n. Default:messages
. -
i18n_default_locale
: Setupi18n
defaut locale. Ignored if you do not use i18n. Default:en
. -
use_edgedb
: Install edgedb-python, add shortcuts to theMakefile
, addedgedb
service to thedocker-compose.yaml
and setup migrationn (if you use Docker). Default:yes
. -
use_docker
: SetupDocker
anddocker-compose.yaml
files, add shortcuts to theMakefile
. Default:yes
. -
use_pre_commit
: Setup pre-commit framework with linters (See the linter installation below). Default:yes
. -
use_black
: Setup black formatter. Default:yes
. -
use_isort
: Setup isort formatter. Default:yes
. -
use_mypy
: Setup mypy linter. Default:yes
. -
use_flake8
: Setup flake8 linter. Default:yes
. -
use_wemake_python_styleguide
: Setup wemake-python-styleguide. Default:yes
.
After generation, you need to install the dependencies. You can do this with the make install
command.
This command will install dependencies from pyproject.toml
file. If you use edgedb
and/or pre-commit
, this command will install those as well.
After that, it is recommended that you run the make reformat
command to format the code.
If you are using i18n
, read about it below before running the bot.
After installation, you must set the BOT_TOKEN
environment variable and run bot via make run
command.
- Setup environment variables via
docker-compose.yaml
- Run
make docker-up-db
command if you useedgedb
. - Run
make docker-up-app
command.
If you are using Docker
, the migrations are performed before the bot starts. Read the EdgeDB documentation on how to create a migration file.
First run:
- Run
make text-init
command to create directories and first language (i18n_default_locale
) - Translate.
- Run
make text-compile
command.
Updating:
- Run
make text-update
command. - Translate.
- Run
make text-compile
command.
Add new language:
- Run
make text-create-language language=your_lang
. - Translate.
- Run
make text-compile
command.
I don't know yet.
Run make help
command to find out all the commands.