Skip to content

Simple aiogram webhook template based on fastapi

Notifications You must be signed in to change notification settings

bralbral/fastapi_aiogram_template

Repository files navigation

fastapi_aiogram_template

Simple aiogram webhook template based on fastapi.

Run

Tested on Ubuntu 22.04, Python 3.11, Docker version 24.0.5

  1. Rename example.config.yaml to config.yaml, example.env to .env, example.docker-compose.yml to docker-compose.yml

  2. Fill TELEGRAM_API_ID and TELEGRAM_API_HASH in .env file. Use this for obtain values.

  3. Fill token in config.yaml. Use BotFather for obtain it.

  4. docker-compose up -d or if you have new docker docker compose up -d

  5. Just test it: send message to your bot.

Hosting

You can rent a server from various hosters, for example from Aeza.

By registering via the link you will support the project and receive a 15% bonus on your balance, which will be valid for 24 hours.

The bot will require the simplest VDS, in rubles this is approximately 100-200 for promotional offers, or about 500 rubles per month.

Develop and Contribute

Feel free to create issue or pull request.

For development, you should install the requirements from requirements_dev.txt

pip install -r requirements_dev.txt

Use pre-commit.sh before commit.