> ## 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 Discord

> Put an agent on Discord as a bot that answers your direct messages and @mentions in your server.

Each Discord bot is a direct line to one agent. People on the bot's list can send it direct messages. When server channels are on, the bot also answers when someone @mentions it in a server that it was invited to.

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

## Before you start

* You need a Discord account, and the Manage Server permission on the server where you want the bot.
* Get your Discord user ID. In Discord, open Settings, then Advanced, and turn on Developer Mode. Then right-click your own profile and click Copy User ID. The ID has 17 to 20 digits.

## Open the Discord screen

Use one of these paths:

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

## Connect a bot

<Steps>
  <Step title="Open the Developer Portal">
    Open the Discord Developer Portal at discord.com/developers/applications.
  </Step>

  <Step title="Create an application">
    Click New Application and give it a name.
  </Step>

  <Step title="Turn on Message Content Intent">
    Open Bot, and switch on Message Content Intent.
  </Step>

  <Step title="Copy the token">
    Click Reset Token and copy the token.
  </Step>

  <Step title="Paste the token">
    On the Squad **Discord** screen, under **Put an agent on Discord**, paste the token into **Paste the bot token**.
  </Step>

  <Step title="Add your user ID">
    Under **Add yourself and connect**, type your Discord user ID.
  </Step>

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

  <Step title="Open the invite link">
    In the message that confirms the connection, click **add it to your server**. You can also use **Add to a server →** on the bot's card later.
  </Step>

  <Step title="Authorize the bot">
    In Discord, pick your server and authorize the bot.
  </Step>
</Steps>

The invite link asks Discord for three permissions: View Channels, Send Messages, and Read Message History.

<Warning>Type your own user ID, not the bot's ID. The Developer Portal shows the bot's ID in several places. Squad refuses the bot's ID.</Warning>

### Check that it works

* The bot shows as a card with **Online**.
* Send the bot a direct message in Discord. The agent answers.
* In a server channel, @mention the bot. The agent answers.

Discord delivers direct messages to a bot only when you share a server with it. Add the bot to a server first, then send it a direct message.

## Set up the bot

Each bot card has 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 Discord user IDs that can send the bot direct messages. Everyone else is refused.                                                        |
| **Answer in server channels** | On by default. The bot answers when someone @mentions it in a server that it was invited to. When off, the bot answers direct messages only. |
| **Add to a server →**         | Opens the Discord invite link for the bot.                                                                                                   |
| **Remove**                    | Removes the bot. Click **Really remove? Messages stop immediately** to confirm.                                                              |

To add a person to **Who can message it**:

1. Ask the person for their Discord user ID. They get it the same way as you did.
2. Type the ID into the field under **Who can message it**.
3. Click **Add**.

The person must also share a server with the bot. A list can hold up to 50 people. See [Limits and defaults](/docs/limits-and-defaults).

## Known limits

* In server channels, the bot does not check its list. Anyone who can @mention the bot in a server where it was invited gets an answer. If only the people on the list may use the bot, turn off **Answer in server channels**.
* The list cannot be empty. You can remove yourself when someone else is on the list. Squad does not keep you on a Discord list.
* If the card says that your squad's runtime limits the bot to specific servers and channels, the limit was set on your workspace computer. Ask your lead to change it.

## Troubleshooting

**Squad says "That doesn’t look like a Discord bot token."**
Cause: the token is incomplete. Fix: click Reset Token in the Developer Portal and paste the new token.

**Squad says that Discord rejected the token.**
Cause: the token is old or was reset. Fix: click Reset Token in the Developer Portal and paste the new token.

**The bot does not answer direct messages.**
Cause: you do not share a server with the bot, or the sender is not on the list. Fix: add the bot to a server with **Add to a server →**, and check **Who can message it**.

**The bot does not answer in a server channel.**
Cause: **Answer in server channels** is off, or the message does not @mention the bot. Fix: turn on the switch and @mention the bot. Also check that Message Content Intent is on in the Developer Portal, as in the setup steps.

**You cannot remove the last person on the list.**
Cause: an empty list answers nobody, so the **×** on the last ID is off. Fix: add another person first.

### Other messages

| Message                                                                                       | Cause                                                             | Fix                                              |
| --------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- | ------------------------------------------------ |
| "That doesn’t look like a Discord user ID (17–20 digits — …)."                                | The ID under **Add yourself and connect** is not 17 to 20 digits. | Copy your user ID again, with Developer Mode on. |
| "That's the bot's own ID — enter YOUR user ID (right-click your own profile → Copy User ID)." | You typed the bot's ID.                                           | Type your own user ID.                           |
| "Couldn’t reach Discord to verify the token — try again."                                     | Squad could not reach Discord.                                    | Wait a moment, then try again.                   |
| "Discord user IDs are 17–20 digit numbers, e.g. 246813579246813579."                          | An ID that you add to the list is not valid.                      | Copy the person's user ID again.                 |
| "Keep at least one person — an empty list answers nobody."                                    | You tried to remove the last person.                              | Add another person first.                        |
| "Couldn’t connect the bot."                                                                   | The connection did not go through.                                | Try again.                                       |

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