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

# Connect Telegram

> Connect your main Telegram bot, then add extra bots for other agents and other people.

Telegram is optional. Setup does not ask for it, and you can connect it at any time. Telegram has two kinds of bots:

* **The main bot.** Your lead agent answers it, and only you can message it. You connect it first.
* **Extra bots.** Each one has its own agent and its own list of people who can message it.

For how channels compare, see [Talk to your squad from Telegram, Discord, or Slack](/docs/channels).

## Before you start

* Have the Telegram app open, signed in to your own account.
* Get your Telegram user ID. Send any message to @userinfobot on Telegram, and copy the number that it sends back.

## Open the Telegram screen

Use one of these paths:

* Open **Integrations**, click the **Channels** tab, and click **Telegram**.
* Open **Settings** and click **Telegram** under **CONNECTIONS**.

## Connect the main bot

<Steps>
  <Step title="Create the bot">
    In Telegram, open @BotFather and send `/newbot`.
  </Step>

  <Step title="Name the bot">
    Give the bot a display name, then a username. The username must end in `bot`.
  </Step>

  <Step title="Copy the token">
    Copy the token that BotFather sends. It looks like `123456789:AA…`.
  </Step>

  <Step title="Paste the token">
    On the Squad **Telegram** screen, paste the token into the **Paste its token** step.
  </Step>

  <Step title="Wait for the check">
    Wait for **✓ Found** followed by the bot username. This means Telegram accepted the token.
  </Step>

  <Step title="Add your user ID">
    If the **Add your Telegram user ID** step shows, type your Telegram user ID.
  </Step>

  <Step title="Connect">
    Click **Connect** followed by the bot username.
  </Step>

  <Step title="Pair the bot">
    In Telegram, send the bot one message. This pairs the bot with your account.
  </Step>
</Steps>

Your squad restarts, which takes about 10 seconds, and then answers from the bot.

<Warning>Check your user ID before you click **Connect**. Squad keeps the first ID that you enter, and the dashboard does not ask for it again.</Warning>

<Warning>Keep the bot token secret. Anyone with the token controls the bot.</Warning>

### Check that it works

* The **Main bot** card shows **Connected**.
* **Access** shows **Locked to your Telegram account**.
* **Who can message it** shows **Just you**.
* Your lead answers when you message the bot. **Open in Telegram →** opens the bot.

## What the main bot does

* Your lead agent answers it. The main bot card has no **Answered by** control.
* Only you can message it. You cannot add other people to it. To share an agent with someone, connect an extra bot.
* **Answer in group chats** is off when you first connect. If you turn it on, the bot works in group chats that it is added to, but it still answers only you.

To use a different bot as the main bot:

1. On the **Main bot** card, click **Switch to a different bot…**.
2. Paste the new bot's token and wait for **✓ Found**.
3. Click **Switch to** followed by the new bot username.
4. In Telegram, send the new bot one message to pair again.

<Warning>The old bot stops responding immediately when you switch.</Warning>

## Add an extra bot

Extra bots run alongside the main bot. Use them to put another agent on Telegram, or to let other people talk to an agent.

Before you start: the main bot must be connected. Without it, Squad refuses the extra bot with "Connect your main bot first — this workspace has no Telegram owner yet."

<Steps>
  <Step title="Create the bot">
    In Telegram, open @BotFather, send `/newbot`, and copy the new token.
  </Step>

  <Step title="Find the More bots card">
    On the Squad **Telegram** screen, find the **More bots** card.
  </Step>

  <Step title="Paste the token">
    Under **Put another agent on Telegram**, paste the token into **Paste its token and connect**.
  </Step>

  <Step title="Connect">
    Click **Connect bot**.
  </Step>
</Steps>

Do not use the main bot's token. Squad refuses it.

The new bot shows on the **More bots** card with these controls:

| Control                   | What it does                                                                                 |
| ------------------------- | -------------------------------------------------------------------------------------------- |
| **Answered by**           | The agent that answers this bot. The default is **The lead (default)**.                      |
| **Who can message it**    | The people who can message this bot. You are always on the list.                             |
| **Answer in group chats** | On by default for extra bots. In a group, the bot still answers only the people on its list. |
| **Group topics**          | Creates a topic in a group chat that uses Topics.                                            |
| **Remove**                | Removes the bot. Click **Really remove? Messages stop immediately** to confirm.              |

The card also shows **Online** or **Offline**.

### Choose who can message an extra bot

1. Ask the person to send any message to @userinfobot on Telegram and send you the number.
2. On the bot's card, under **Who can message it**, type the number into the field.
3. Click **Add**.

To remove a person, click **×** on their ID. Squad always keeps you on the list.

A list can hold up to 50 people, including you. See [Limits and defaults](/docs/limits-and-defaults).

### Create a topic in a group

<Steps>
  <Step title="Turn on Topics">
    Turn on Topics in the Telegram group settings.
  </Step>

  <Step title="Add the bot">
    Add the extra bot to the group.
  </Step>

  <Step title="Open Group topics">
    On the bot's card, click **Group topics**.
  </Step>

  <Step title="Enter the group and topic">
    Paste the group's chat ID, for example `-1001234567890`, and type a **Topic name**.
  </Step>

  <Step title="Create">
    Click **Create**.
  </Step>
</Steps>

The card confirms that the topic was created.

## Troubleshooting

**The main bot does not answer.**
Cause: the bot is not paired yet, or the squad is still restarting. Fix: send the bot one message, then wait a short time and try again.

**Someone cannot message an extra bot.**
Cause: their ID is not on the bot's list, or they are in a group and not on the list. Fix: add their Telegram user ID under **Who can message it**.

**The Access line shows "No Telegram owner on file. Contact support".**
Cause: the workspace has no Telegram user ID for you. Fix: contact support. See [Get help](/docs/getting-help).

### Messages when you paste a token

| Message                                                                                                                                  | Cause                                                     | Fix                                                  |
| ---------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------- | ---------------------------------------------------- |
| "Telegram doesn’t recognize that token. Copy it fresh from BotFather." or "Telegram rejected that token — double-check it in BotFather." | The token is wrong, incomplete, or was revoked.           | Copy the token again from @BotFather.                |
| "That doesn’t look like a Telegram bot token."                                                                                           | The text is not in the token format `123456789:AA…`.      | Copy the whole token, with the number and the colon. |
| "Couldn’t reach Telegram to check the token." or "Couldn’t reach Telegram to verify the token — try again."                              | Squad could not reach Telegram.                           | Wait a moment, then paste the token again.           |
| "This bot token is already connected to another workspace — create a fresh bot with @BotFather and use its token"                        | A main bot works in one workspace only.                   | Create a new bot with @BotFather and use its token.  |
| "That token belongs to a main bot — create a fresh bot with @BotFather."                                                                 | You pasted a main bot's token as an extra bot.            | Create a new bot for the extra bot.                  |
| "Connect your main bot first — this workspace has no Telegram owner yet."                                                                | You added an extra bot before the main bot.               | Connect the main bot first.                          |
| "Couldn’t check the bot’s pending messages — try again in a moment."                                                                     | Squad could not clear old messages that wait for the bot. | Try again in a moment.                               |

### Messages when you connect or switch the main bot

| Message                                                                                                                                                    | Cause                                                             | Fix                                      |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- | ---------------------------------------- |
| "Add your Telegram user ID first — message @userinfobot to get it."                                                                                        | The **Add your Telegram user ID** field is empty or not a number. | Type your Telegram user ID.              |
| "This workspace has no Telegram owner on file. Enter your Telegram user ID (message @userinfobot to get it) and try again."                                | Squad needs your ID before it can lock the bot to you.            | Type your ID and try again.              |
| "Couldn’t reserve the new bot token — nothing changed; try again."                                                                                         | The switch did not start. Your old bot still works.               | Try again.                               |
| "… — and restoring the previous bot’s routing also failed. Run the rotation again to finish switching (your old bot may not receive messages until then)." | The switch stopped halfway.                                       | Paste the new token and switch again.    |
| "Your new bot is saved, but the workspace runtime is still restarting. Give it a minute; the bot answers once it's back. No need to rotate again."         | The switch worked. The squad is still restarting.                 | Wait a minute, then message the new bot. |
| "Couldn’t switch the bot." or "Couldn’t connect the bot."                                                                                                  | The change did not go through.                                    | Try again.                               |

### Messages on the list and on topics

| Message                                                                                                           | Cause                                                                                                        | Fix                                                                       |
| ----------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------- |
| "Telegram user IDs are numbers, e.g. 726882145." or "Telegram user ids are numbers — check the list."             | The ID has letters or other characters.                                                                      | Type only the number from @userinfobot.                                   |
| "Keep the list under 50 people."                                                                                  | The list is full.                                                                                            | Remove people who no longer need access, or connect another bot for them. |
| "Give the topic a name."                                                                                          | **Topic name** is empty.                                                                                     | Type a name.                                                              |
| "Topics need the group to be a forum: in Telegram, open the group’s settings and turn on Topics, then try again." | Topics is off in the group.                                                                                  | Turn on Topics in the group settings, then click **Create** again.        |
| "This bot isn’t on your squad’s runtime yet."                                                                     | The bot was added a moment ago.                                                                              | Wait a minute, then try again.                                            |
| "Telegram refused to create the topic.", "Couldn’t create the topic.", or another reason from Telegram            | Telegram refused the request, for example because the group chat ID is wrong or the bot is not in the group. | Check the group chat ID and add the bot to the group, then try again.     |

For messages that all channel screens share, see [Messages on every channel screen](/docs/channels#messages-on-every-channel-screen).
