This is a template repo for cloning and reusing to create custom telegram bots with python-telegram-bot library in Python.
- Clone the repo
$ git clone https://github.com/nuriddinislamov/telegram-bot-template my-bot
- Go to project directory, create virtualenv and activate it
$ cd my-bot; python3 -m venv venv; source venv/bin/activate
- Download and install all dependencies with
pip
$ pip install -r requirements.txt
-
Add an environment variable for bot's token. You can get one here with BotFather.
-
❗️ Deprecated version
$ export BOT_TOKEN='your actual token'
-
👍 Recommended Create a file with name
.env
(no name, just .env) and type in your bot's token as:1. BOT_TOKEN='your actual token'
-
-
🎉 Great! Now run the bot and see the magic happen.
$ python3 bot.py
This template is under MIT license.
© Nuriddin Islamov, 2021