Skip to content

Latest commit

 

History

27 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simple telegram bot made in python

simple telegram bot made in python using polling

features

setup

git clone https://github.com/jasurlive/TelegramBotPy.git
cd TelegramBotPy

python -m venv .venv
source .venv/bin/activate

pip install -r requirements.txt
or
pip install python-telegram-bot python-dotenv requests

.env

BOT_TOKEN=<your_telegram_token>
ADMIN_ID=<your_telegram_id>

run

python src/main.py

systemd

use src/main.py as service on linux

sudo nano /etc/systemd/system/telegrambot.service (!)

[Unit]
Description=telegram bot
After=network.target

[Service]
WorkingDirectory=/home/YOURUSERNAME/bot
ExecStart=/home/YOURUSERNAME/bot/.venv/bin/python main.py

Restart=always
Environment="BOT_TOKEN=your_token"
Restart=always
Environment="ADMIN_ID=your_id"

[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable telegrambot
sudo systemctl start telegrambot

you'll also need to run these commands if you make any changes to main.py

license

MIT

About

Simplest telegram bot made in python

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages