Steps to create your first bot

Step 1: After opening an account on Telegram, in the search bar at the top search for “BotFather”

Step 2: Click on the ‘BotFather’ (first result) and type /newbot

Step 3: Give a unique name to your bot. After naming it, Botfather will ask for its username. Then also give a unique name BUT remember the username of your bot must end with the bot, like my_bot, hellobot etc.

Step 4: After giving a unique name and if it gets accepted you will get a message something like this –

Here the token value will be different for you, we will use this token in our python code to make changes in our bot and make it just like we want, and add some commands in it.

Create a Telegram Bot using Python

In this article, we are going to see how to create a telegram bot using Python.

In recent times Telegram has become one of the most used messaging and content sharing platforms, it has no file sharing limit like Whatsapp and it comes with some preinstalled bots one can use in any channels (groups in case of whatsapp) to control the behavior or filter the spam messages sent by users.

Similar Reads

Requirements

A Telegram Account: If you don’t have the Telegram app installed just download it from the play store. After downloading create an account using your mobile number just like WhatsApp. .python-telegram-bot module: Here we will need a module called python-telegram-bot, This library provides a pure Python interface for the Telegram Bot API. It’s compatible with Python versions 3.6.8+. In addition to the pure API implementation, this library features a number of high-level classes to make the development of bots easy and straightforward. These classes are contained in the “telegram.ext” submodule. For more information, you can check their official GitHub repo....

Installation of the module

We can install this module via pip and conda with the below command....

Steps to create your first bot

Step 1: After opening an account on Telegram, in the search bar at the top search for “BotFather”...

Stepwise implement

Step 1: Importing required libraries...