Skip to content

Latest commit

 

History

History
31 lines (22 loc) · 999 Bytes

README.md

File metadata and controls

31 lines (22 loc) · 999 Bytes

telegram-bot-template

A ready-made telegram bot template based on the PTB library with built-in useful features and architecture.

  • A simple bot template for answering questions.
  • Ability to forward messages from user to admin and vice versa.
  • Save users and messages to a database.

Install

Use Python 3

Copy

  • git clone https://github.com/jekeam/telegram-bot-api-template.git
  • mv telegram-bot-api-template.git your_name_project

Create venv

  • python3 -m venv venv

  • venv/bin/python -m pip install --upgrade pip

  • venv/bin/python -m pip install -r requirements.txt

Create DB

  • venv/bin/python create_db.py

Run background bot (autostartup after restart server)

  • Edit and optional - rename file bot.service
  • sudo cp bot.service /etc/systemd/system/
  • sudo systemctl daemon-reload
  • sudo systemctl enable bot
  • sudo systemctl start bot