Skip to content

Latest commit

 

History

History
57 lines (30 loc) · 1.5 KB

TELEGRAM_BOT_INSTRUCTIONS.md

File metadata and controls

57 lines (30 loc) · 1.5 KB

Telegram Instructions

Instructions for creating a new Telegram Bot and getting chat_id from a particular group or chat.

Creating a Bot

  1. Go to @BotFather on Telegram.

  2. Send /newbot, to start creating a new Bot.

    message

  3. Set the bot's username and username.

    defines-a-bot-name

  4. Now you need to allow your Bot to send direct messages, so send /setjoingroups to @BotFather, select your Bot and click Enable:

    set-join-group

  5. Get the Bot token and add it to your .env file.

    get-bot-token

    Bot Token in .env:

    token-in-env-file

Getting a Telegram Chat ID

  • If you want to send messages to a group:

    1. Add your Bot to a Telegram group.
    2. Send any message from another user to this group.
  • If you want send direct messages to a user:

    1. Search for your bot name, and select the chat.
    2. Send /start to your Bot.
  1. Visit the following link to get updates about your bot and get chat_id:

    https://api.telegram.org/botXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/getUpdates

Replace all X in the URL with your Bot Token.

  1. Search for the chat that you want to send messages, and get the chat->id:

    get-a-chat-id

  2. Add it to your .env file:

    env


Hope this helps you!