Skip to content

Telegram Bot


Creating a Telegram bot using BotFather. In Telegram, BotFather helps to create new bots and change settings for existing ones.

1. Creating a bot

Firstly, search for BotFather in the search bar.

1

  • Type /start to start using BotFather. 2

  • Type /newbot to start creating a bot. Give a bot name.

3

  • Give a username to the bot. [Note: The bot's username must end in 'bot', e.g. 'tetris_bot' or 'MannyBot']

  • After successfully finding the right username, the bot is created. Bot name will be displayed like t.me/your_botname_bot and HTTP APT token will be provided.

4

[Note: Keep the token secure and store it safely, it can be used by anyone to control the bot.]

  • The token is required to authorize the bot and send requests to the Bot API.

2. Open bot chat

Click on ‘t.me/your_botname_bot’ to open bot chat.

5

3. Adding bot to Channel or Group

Create a Channel or Group and add the bot with minimum admin privileges.

6

4. Get Telegram Chat ID

After adding the bot to the Channel/Group, send at least one message. Then, visit this link Telegram-Chat-ID and replace XXX:YYYYY with the BOT HTTP API Token in the URL.

(Note: Chat id includes - Eg: {"chat":{"id":-123456789 ,"title":"Test","type":"channel"} ie. chat-id is-123456789)


  1. Contributors: Ujan Man Shakya