How to create a Telegram bot, and send messages with Python

This is Python3 btw

Creating your bot

  1. On Telegram, search @ BotFather, send him a “/start” message
  2. Send another “/newbot” message, then follow the instructions to setup a name and a username
  3. Your bot is now ready, be sure to save a backup of your API token, and correct, this API token is your bot_token
The part blurred in blue is where you will find your API token

Getting your Chat id

  1. On Telegram, search your bot (by the username you just created), press the “Start” button or send a “/start” message
  2. Open a new tab with your browser, enter https://api.telegram.org/bot<yourtoken>/getUpdates , replace <yourtoken> with your API token, press enter and you should see something like this:
{"ok":true,"result":[{"update_id":77xxxxxxx,
"message":{"message_id":550,"from":{"id":34xxxxxxx,"is_bot":false,"first_name":"Man Hay","last_name":"Hong","username":"manhay212","language_code":"en-HK"}

Sending messages regularly

Reporting your account balance everyday at noon

--

--

--

Finding the balance between Business and Tech. Crypto lover? Checkout: https://cryptodenada.com/. Need a website/app built? Checkout: https://denadahk.com/.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

What Is Bull Bear Strike Token (BBS)

YouTube is in Trouble, and Bitcoin Can Save It.

Notifi : 2.5 million in Pre-seed

The Bully Pit Review: What the New CoinBase Announcement Really Means

Zenlink is now Live on Moonbeam and Launching the Liquidity Incentive Program!

Benefits of NFT Token Development

INCI. FINANCE: SECURING YOUR DIGITAL ASSETS Have you ever wondered why we are always advised to get…

‘The Update’ Episode 3: Content Creators Can Earn Money on Stratus

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Man Hay Hong

Man Hay Hong

Finding the balance between Business and Tech. Crypto lover? Checkout: https://cryptodenada.com/. Need a website/app built? Checkout: https://denadahk.com/.

More from Medium

Introduction to Asyncio in Python

Virtual environment Setup for python project

DeFiLlama-Curl Python API

How to Run Python Flask App Online using Ngrok?