Skip to content
/ blank-telegram-bot Public template

Ready to user blank telegram bot template with multilanguage support

Notifications You must be signed in to change notification settings

damhuman/blank-telegram-bot

Repository files navigation

blank-telegram-bot

Welcome to the Blank Telegram Bot template, an awesome and efficient way to create async Telegram bots with an Admin panel. This template offers built-in support for multilanguage logic, making it a perfect choice for your next bot development project.

Tech Stack

This template uses the following technologies:

How to run

To start working on this project, follow these steps:

  1. Clone the repository:
git clone https://github.com/damhuman/blank-telegram-bot
cd blank-telegram-bot
  1. Create a .env file in the root directory:
cp template.env .env
  1. Replace the TOKEN value in the .env file.

  2. To start the bot, run the following command:

docker-compose up --build -d

Note: On the first run, the bot container will fail because the database for the project hasn't been created yet. You can use the db container (PostgreSQL) to create it, but you can also use any other database for the bot (SQLite/MySQL/MariaDB).

  1. To create the database, run the following commands:
docker-compose exec db psql -U postgres
create database bot_db;
create user bot_db_user with password '111';
grant all privileges on database bot_db to bot_db_user;

After this step, the DB_URL will be:

DB_URL=postgresql://bot_db_user:111@db:5432/bot_db

After configuring the database, you can start the bot again using docker-compose:

docker-compose up --build -d

Admin Panel

This template comes with preconfigured basic logic for the UI Admin panel, which you can find at http://localhost/admin_panel. It uses Basic Auth logic for login, and you can change the credentials in the .env file. image

Database Migrations

You can use the alembic framework to handle database migrations. To create a migration, use the following command:

alembic revision --autogenerate -m "Message"

Migrations are applied automatically when you run the docker-compose up command. If your table is not parsed via alembic, you have to import it inside the env.py alembic file:

database/alembic/env.py

Contributing

We welcome pull requests! For major changes, please open an issue first to discuss what you would like to change.

License

This template is licensed under the MIT License.

Additional resources

About

Ready to user blank telegram bot template with multilanguage support

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published