> ## Documentation Index
> Fetch the complete documentation index at: https://chatbotx.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Telegram

> Configure Telegram integration for ChatbotX.

**Telegram** is one of the most popular messaging channels. By connecting your Telegram Bot to ChatbotX, you can receive messages in the unified Inbox, set up automated Flows, and use AI Agents to provide 24/7 customer support.

## Prerequisites

Before you begin, make sure you have:

* A Telegram account
* A ChatbotX installation

<Info>
  Unlike Facebook or Zalo, Telegram does not require complex app reviews or any credential configuration in ChatbotX. You only need to create a Bot and paste the Bot Token.
</Info>

## Step 1: Get your Bot Token

You can connect a **new** Telegram bot or **reuse an existing** one. Either way, you need the bot's API Token.

<Tabs>
  <Tab title="Create a new bot">
    <Steps>
      <Step title="Open BotFather">
        Open the Telegram app and search for **@BotFather**, or visit [https://t.me/BotFather](https://t.me/BotFather). Click **Start** to begin the conversation.
      </Step>

      <Step title="Create a new bot">
        Send the `/newbot` command. BotFather will ask for two pieces of information:

        * **Name**: the display name of your bot (for example, `ChatbotX Customer Support`)
        * **Username**: the unique username, which must end with `bot` (for example, `chatbotx_support_bot`)
      </Step>

      <Step title="Copy the Bot Token">
        Once created, BotFather will send you a message containing the **API Token** (for example, `123456789:ABCDEF1234ghIkl-zyx57W2v1u123ew11`). Copy the entire token.

        <Note>
          The Bot Token is the key to your bot. Never share it publicly. If you suspect it has been compromised, send `/revoke` to BotFather to generate a new one.
        </Note>
      </Step>
    </Steps>

    <Frame>
      <img src="https://mintcdn.com/chatbotx/49Ui_fPVyLShWBNl/images/image-297.png?fit=max&auto=format&n=49Ui_fPVyLShWBNl&q=85&s=abcad16670837ba704c8b800a32ea5b4" alt="create_bot_by_botfather" width="2136" height="1880" data-path="images/image-297.png" />
    </Frame>
  </Tab>

  <Tab title="Use an existing bot">
    If you already have a Telegram bot, you can retrieve its token from BotFather at any time.

    <Steps>
      <Step title="Open BotFather">
        Open the Telegram app and search for **@BotFather**, or visit [https://t.me/BotFather](https://t.me/BotFather).
      </Step>

      <Step title="List your bots">
        Send the `/mybots` command. BotFather will show a list of all bots you own. Select the bot you want to connect to ChatbotX.
      </Step>

      <Step title="Copy the API Token">
        Tap **API Token** to reveal the token for that bot. Copy the entire token.

        <Warning>
          Connecting an existing bot to ChatbotX will replace any webhook previously registered for that bot. Messages will stop flowing to the old endpoint and will be routed to ChatbotX instead. Make sure you no longer need the previous integration before proceeding.
        </Warning>
      </Step>
    </Steps>
  </Tab>
</Tabs>

## Step 2: Connect to ChatbotX

<Steps>
  <Step title="Open Channel settings">
    In ChatbotX, go to **Settings → Channels**.
  </Step>

  <Step title="Open the Telegram section">
    Click the **Telegram** row in the channel list, then click **Add Telegram**.

    <Frame>
      <img src="https://mintcdn.com/chatbotx/49Ui_fPVyLShWBNl/images/image-298.png?fit=max&auto=format&n=49Ui_fPVyLShWBNl&q=85&s=3149e22a9c4cac5f635dc5519fddd5b6" alt="chatbotx_settings_channels_tab" width="3021" height="1330" data-path="images/image-298.png" />
    </Frame>
  </Step>

  <Step title="Enter the Bot Token">
    Paste the **Bot Token** you copied from BotFather into the input field.

    <Frame>
      <img src="https://mintcdn.com/chatbotx/49Ui_fPVyLShWBNl/images/image-299.png?fit=max&auto=format&n=49Ui_fPVyLShWBNl&q=85&s=270541bb5e997680eef89fc9ce7a80e0" alt="chatbotx_add_telegram_bot_token_modal" width="3027" height="1344" data-path="images/image-299.png" />
    </Frame>
  </Step>

  <Step title="Connect">
    Click **Connect**. ChatbotX will automatically set up the webhook connection with Telegram to start receiving and sending messages.

    <Frame>
      <img src="https://mintcdn.com/chatbotx/49Ui_fPVyLShWBNl/images/image-300.png?fit=max&auto=format&n=49Ui_fPVyLShWBNl&q=85&s=4dde9ab56b22cbab53e24af148cf7dc9" alt="chatbotx_telegram_channel_connected_success" width="2446" height="447" data-path="images/image-300.png" />
    </Frame>
  </Step>
</Steps>

## Step 3: Test the Connection

After connecting, run a quick test to confirm everything is working:

* **Send a message**: Open the Telegram app, search for your bot's username, and send any message (for example, `Hello`). It should appear in the ChatbotX **Inbox** shortly after.
* **Test an automated Flow**: Create a Flow or configure an AI Agent in ChatbotX, then send another message to your bot to verify it responds automatically as configured.
