Skip to content
This repository has been archived by the owner on Feb 6, 2025. It is now read-only.

Template for Telegram-bot that using webhook with tunneling it to the Web with ngrok, written in Python with aiogram and FastAPI / Шаблон для Telegram-бота, использующего вебхук с его туннелированием в Интернет с ngrok, написанный на Python с помощью FastAPI и aiogram

License

Notifications You must be signed in to change notification settings

amozebus/fastapi-aiogram-ngrok-template-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

English | Русский

Telegram-bot template (fastapi-aiogram-ngrok-template-bot)

code style: black

Template for Telegram-bot that using webhook. Written in Python with aiogram and FastAPI

Tunneling webhook to the Web with ngrok.

How to launch (Docker Compose)

  1. Create a Telegram bot using @BotFather, copy API token

  2. Rename the .env.example file to .env and fill BOT_API_TOKEN field with copied token

  3. Create an account on ngrok, copy your authentication token and paste it to NGROK_AUTHTOKEN field in .env

  4. Create an HTTPS Edge on ngrok dashboard, copy URL in Endpoints section and paste it to NGROK_URL field in .env file

  5. Copy edge label without edge= in beginning and paste it to NGROK_EDGE field in .env file

For Windows:

  1. Install and start Docker Desktop

For Linux:

  1. Install docker, docker-compose packages with package manager of your distro

  2. Run this command in root of project:

docker compose up --build
  1. Check the bot in Telegram. Search it by the username which you gave to @BotFather

About

Template for Telegram-bot that using webhook with tunneling it to the Web with ngrok, written in Python with aiogram and FastAPI / Шаблон для Telegram-бота, использующего вебхук с его туннелированием в Интернет с ngrok, написанный на Python с помощью FastAPI и aiogram

Resources

License

Stars

Watchers

Forks