A simple Python script template to generate a Telegram bot to notify you whatever you want
- Requires Python 3.7.4+
- The only dependency: requests
$ git clone git@github.com:Junyong-Suh/telegram-bot.git
$ python --version
Python 3.7.7
$ cd telegram-bot
$ pip3 install -r requirements.txt
Rename credentials_empty.py
to credentials.py
and set your credentials
- How to get your own Telegram Bot and the ID: https://core.telegram.org/bots
Add your Telegram ID(s) to constants.py
- How to get your Telegram ID: https://support.bigone.com/hc/en-us/articles/360008014894-How-to-get-the-Telegram-user-ID-
(Optional) Once you update your credentials, make Git not to track the file
# untrack
$ git update-index --assume-unchanged confidentials.py
# track again
# git update-index --no-assume-unchanged confidentials.py
Turn on your Telegram App, find your bot and add.
python main.py
You will get messages from the bot
Assume that you set the credentials and subscribed to your bot.
- Build the image
docker build -t telegram-bot:latest .
- Run
docker run telegram-bot:latest
Please make an issue and a PR :-)