Using Python To Send Telegram Messages In 3 Simple Steps

Liu Zuo Lin
CodeX
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

  1. Create a Telegram Bot using Telegram’s BotFather
  2. Getting your chat ID
  3. Sending your Telegram message using Python

1. Create A Telegram Bot Using Telegram’s BotFather

  1. Open your telegram app and search for BotFather. (A built-in Telegram bot that helps users create custom Telegram bots)
  2. Type /newbot to create a new bot
  3. Give your bot a name & a username
  4. 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.

2. Getting your chat ID

--

--