Using Python To Send Telegram Messages In 3 Simple Steps
Published in
3 min readJun 3, 2022
So maybe you’re running some program that takes some time to run, and want to take a nap or something. You probably need a simple script to send you an update when your program finishes running. We can easily write a Python function that sends you a Telegram message whenever you call it.
3 Simple Steps
- Create a Telegram Bot using Telegram’s BotFather
- Getting your chat ID
- Sending your Telegram message using Python
1. Create A Telegram Bot Using Telegram’s BotFather
- Open your telegram app and search for BotFather. (A built-in Telegram bot that helps users create custom Telegram bots)
- Type
/newbot
to create a new bot - Give your bot a name & a username
- Copy your new Telegram bot’s token
Note: don’t upload your token online, as anyone with your token has full control of your Telegram bot.