What is Bot?

According to Wikipedia, It is a software application that runs automated tasks (scripts) over the Internet. In other terms, It is a program written to mimic human behaviour in order to perform some tasks. Bots take input and do simple and repetitive tasks, which is much faster than humans.

There are two types of bots:

  • Good Bots: Bots that are beneficial to organizations as well as individuals such as ChatBots, Social Media bots, etc
  • Bad Bots: These are the bots that are used to perform malicious activities such as Scraping and Spamming.

In this, We will make Telegram Chatbot, which would send a copy of the input that the user has sent.

Making our Telegram Chatbot

We will be using Python language to make the bot and will be using Telegram package for our bot. You can know more about the telegram package from here

Firstly, we will generate our telegram token. Below are the steps to follow to generate your own token.

  1. Search BotFather on Telegram.
  2. Type /start to get started.
  3. Type /newbot to get a bot.
  4. Enter your Bot name and unique Username, which should end with the bot.
  5. Then, you would get your Bot token.

After generating our token, we will make a python program to create a Telegram bot that will send the Text, Emojis, and Stickers similar to the user’s input.

  • Importing libraries required.
import logging
from telegram.ext import Updater, Filters, CommandHandler, MessageHandler
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',     #take time,level,name
                    level=logging.INFO)
logger = logging.getLogger(__name__)

#telegram bot #python

How to make a telegram bot
1.35 GEEK