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

# Discord

> Connect Discord to Adapt to read and send messages in the channels and servers your bot can access

Connect Discord to Adapt by creating a Discord application with a bot, so Adapt can read and send messages in the channels and servers the bot can access.

## Set up credentials

<Steps>
  <Step title="Open the Discord Developer Portal">
    Go to [discord.com/developers/applications](https://discord.com/developers/applications) and sign in.
  </Step>

  <Step title="Create an application">
    Click **New Application**, enter a name, and click **Create**. You land on the **General Information** page.
  </Step>

  <Step title="Copy your Application (Client) ID">
    On the **General Information** page, copy the **Application ID**. This is your client ID.
  </Step>

  <Step title="Create the bot and copy its token">
    Open the **Bot** page, click **Reset Token**, then copy the token immediately. The token is shown only once, so store it right away.
  </Step>

  <Step title="Enable the intents you need">
    On the **Bot** page, under **Privileged Gateway Intents**, enable the intents your use case requires (for example **Message Content Intent** to read message text), then click **Save Changes**.
  </Step>

  <Step title="Invite the bot to your server">
    Go to **OAuth2 > URL Generator**, select the `bot` scope (and `applications.commands` for slash commands), choose the bot permissions you need such as **Read Messages** and **Send Messages**, then open the generated URL, pick your server, and click **Authorize**. You need the **Manage Server** permission on that server.
  </Step>
</Steps>

<Note>
  Intents must be enabled in the Developer Portal for the bot to receive the matching events. Bots in 100 or more servers require Discord verification to use privileged intents.
</Note>

## Connect to Adapt

<Steps>
  <Step title="Open Integrations">
    In Adapt, go to **Settings > Integrations**.
  </Step>

  <Step title="Find Discord">
    Search for **Discord** and select it from the catalog.
  </Step>

  <Step title="Start the connection">
    Click **Connect** to open the connection form.
  </Step>

  <Step title="Add your credentials">
    Enter the values you gathered above, then click **Add connection**:

    | Secret Name         | Value                                   |
    | ------------------- | --------------------------------------- |
    | `DISCORD_TOKEN`     | Your bot token                          |
    | `DISCORD_CLIENT_ID` | Your application's client ID (optional) |

    You can rename the connection and choose whether it is shared with your
    organization or kept personal to you.
  </Step>

  <Step title="Test the connection">
    Ask Adapt to list the channels your bot can access.
  </Step>
</Steps>

### Security

* Credentials are encrypted at rest with AES-256
* The bot can only access the servers it has been invited to and the channels its permissions allow
* If your bot token is exposed, reset it immediately in the Developer Portal to invalidate the old one
* Never share or commit your bot token

## Capabilities

Adapt can read and send messages and read the channels and servers your bot has access to, scoped to the bot's permissions and intents.

### Examples

```
Summarize the latest messages in my Discord support channel.
```

```
Send a message to the #announcements channel in my server.
```

```
List the channels my Discord bot can access.
```

```
What questions came up in my Discord community this week?
```
