---
title: "Add your bot to a Discord server"
description: "Connect your bot to Discord so it answers slash commands, @mentions and direct messages in your server, using your knowledge and power-ups."
canonical_url: "https://chatthing.ai/docs/channels/discord"
last_updated: "2026-09-25"
---

# Add your bot to a Discord server

**Available on:** Standard, Pro, Enterprise plans.

Bring your bot into a Discord server so your community can ask it questions.

> **Standard, Pro and Enterprise**
>
> The Discord channel is included on the Standard, Pro and Enterprise plans.
>
> **Who can do this:** [team owners and admins](https://chatthing.ai/docs/account/teams#what-each-role-can-do).

## What the bot can do

Chat Thing connects to Discord in one of two ways, called transports. You choose one at the top of the channel settings.

|  | **Gateway (recommended)** | **Legacy** |
| --- | --- | --- |
| Answer a slash command | Yes | Yes |
| Reply to @mentions in channels | Yes | No |
| Reply to direct messages | Yes | No |
| Keep context in threads | Yes | No |
| Read recent channel messages when @mentioned | Yes | No |
| Needs the Message Content Intent | Yes | No |

New channels use **Gateway**. Choose **Legacy** only if you want slash commands alone and don't want to turn on extra Discord permissions.

![The Discord transport selector with Gateway (recommended) and Legacy options](https://res.cloudinary.com/djyjvrw5u/image/upload/v1777999783/docs/discord-transport-selector.png)

## Create a Discord application

[Video: connect a bot to Discord (YouTube)](https://www.youtube.com/watch?v=DCBzxgWjyJk)

*Video walkthrough, recorded in 2024 before the Gateway transport existed. Some screens have changed since.*

1. Go to the [Discord developer portal](https://discord.com/developers/applications) and click **New Application**.
2. Give it a name and create it.
   ![Discord's Create an application dialog with the Name field filled in, the terms checkbox ticked and the Create button](https://res.cloudinary.com/djyjvrw5u/image/upload/v1688047072/Xnapper_2023_06_29_14_57_20_a7cc7c4ef0.png)
3. On the application's **General Information** page, copy the **Application ID**.

## Connect it to Chat Thing

1. In Chat Thing, open your bot, select the **Channels** tab and turn on the **Discord** card. The **Discord bot settings** page opens.
   ![The Discord card in the Channels tab with its on/off toggle](https://res.cloudinary.com/djyjvrw5u/image/upload/v1773771833/docs/discord-channel-toggle.png)
2. Under **Discord transport**, keep **Gateway (recommended)** or choose **Legacy**.
3. Paste the ID into **Application ID**. The rest of the settings appear.
4. Under **Credentials**, fill in the three values from the Discord developer portal. The links in this section take you to the right pages.
   - **Client secret** - on the **OAuth2** page. Click **Reset Secret** to reveal it.
   - **Bot public key** - the **Public Key** on the **General Information** page.
   - **Bot token** - on the **Bot** page. Click **Reset Token** to reveal it.
   ![The Credentials section with Client secret, Bot public key and Bot token fields](https://res.cloudinary.com/djyjvrw5u/image/upload/v1773771836/docs/discord-credentials.png)
   ![The Token section on the Bot page in the Discord developer portal with the Reset Token button](https://res.cloudinary.com/djyjvrw5u/image/upload/v1688048778/Xnapper_2023_06_29_15_25_16_7e19a9643c.png)
5. **Gateway only:** on the **Bot** page in Discord, under **Privileged Gateway Intents**, turn on **Message Content Intent** and save. Without it the bot can't read @mentions or DMs, and saving in Chat Thing fails.
6. Optional: under **Bot command**, set the **Bot slash command** (for example `/askbot`) and **Bot slash command description**. The command must start with `/`, use only lowercase letters and numbers, and be at least 4 characters long.
   ![The Bot command section with the Bot slash command and Bot slash command description fields](https://res.cloudinary.com/djyjvrw5u/image/upload/v1773771839/docs/discord-bot-command.png)
7. Click **Save**. Do this before the next step.
8. Under **Integration URLs**, copy the **Interactions endpoint URL** and paste it into **Interactions Endpoint URL** on the **General Information** page in Discord. Save the changes in Discord.
   ![The Interactions Endpoint URL field in the Discord developer portal with a Chat Thing commands URL pasted in](https://res.cloudinary.com/djyjvrw5u/image/upload/v1688049387/Xnapper_2023_06_29_15_34_34_efc83fbca1.png)
9. Copy the **OAuth2 redirect URL** and add it as a redirect on the **OAuth2** page in Discord. Save the changes in Discord.
   ![The Redirects section of Discord's OAuth2 page with the Chat Thing callback URL added](https://res.cloudinary.com/djyjvrw5u/image/upload/v1688049387/Xnapper_2023_06_29_15_33_55_b5ffce5624.png)
10. Under **Add to Discord**, click **Add to Discord**, choose your server and authorise the bot. With Gateway, the bot asks for permission to read messages so it can respond to @mentions; with Legacy it only asks to send messages.
    ![The Add to Discord section of the Discord bot settings with the Add to Discord button](https://res.cloudinary.com/djyjvrw5u/image/upload/v1773771838/docs/discord-add-to-discord.png)
    ![Discord's Success screen confirming the app has been authorised and added to the server](https://res.cloudinary.com/djyjvrw5u/image/upload/v1688049865/Xnapper_2023_06_29_14_23_14_aa3a0113bd.png)

## Choose how much channel history the bot sees

With Gateway, when someone @mentions the bot in a channel, it reads the most recent messages there before replying, so it can answer follow-ups like "what does everyone think?". If the @mention is a reply to another message, the bot also sees that message. Discord @mentions are turned into people's names so replies read naturally.

Set how many messages it reads with **Recent messages to include** in the **Ambient context window** section: 0 to 20, default 10. At 0 the bot doesn't read recent messages, but it still sees the message someone replied to.

![The Ambient context window section with the Recent messages to include slider set to 10 messages](https://res.cloudinary.com/djyjvrw5u/image/upload/v1777999009/docs/discord-ambient-context-window.png)

For older or cross-channel history on demand, add the **Discord Get Channel History** power-up - see [Discord power-ups](https://chatthing.ai/docs/power-ups/discord).

## Switch transport

You can change transport at any time in the channel settings:

- The **Interactions endpoint URL** changes when you switch. Copy the new one into Discord's **General Information** page and save.
- If you switch to Gateway, turn on **Message Content Intent** in Discord first.
- Your slash command is registered again automatically when you save.
- The **Ambient context window** setting only appears with Gateway.

## Change the bot's name or icon

Change the icon on the application's **General Information** page, and the display name on the **Bot** page, in the Discord developer portal.

## Check it works

In your Discord server, use the slash command or @mention the bot with a question it should answer. The conversation also appears in [Conversations](https://chatthing.ai/docs/manage/conversations).

## Troubleshooting

### Settings won't save with the Gateway transport

Saving checks that **Message Content Intent** is on. Turn it on under **Privileged Gateway Intents** on the **Bot** page in Discord, then save again.

### Discord won't save the Interactions endpoint URL

Discord checks the URL when you save. This fails if you haven't saved the **Client secret**, **Bot public key** and **Bot token** in Chat Thing yet, or if one of them is wrong. Check them, click **Save** in Chat Thing, then try again in Discord.

### I've done every step and the bot doesn't respond

The usual cause is a credential pasted into the wrong field. Reset the client secret and bot token in Discord, paste them in again, click **Save** and try again. With Gateway, also check **Message Content Intent** is on.

### The bot doesn't know about earlier messages in the channel

- Check **Recent messages to include** isn't set to 0.
- The bot only reads as many messages as the setting allows. Increase it, or add the [Discord Get Channel History power-up](https://chatthing.ai/docs/power-ups/discord).
- Check **Message Content Intent** is on, and that the bot has permission to read the channel in your server's role settings.
- Recent-message context only works with Gateway.

### The bot replies "This bot is currently unavailable"

The Discord channel is turned off. Turn the **Discord** card back on in the **Channels** tab.

## Related

- [Read Discord channel history from your bot](https://chatthing.ai/docs/power-ups/discord): Let your bot pull message history from any Discord channel it can access, for cross-channel summaries or messages older than its usual context.
- [Channels](https://chatthing.ai/docs/channels): Where your bot talks to people - your website, WhatsApp, Slack, Discord, Telegram, email and the API - and which plans include each channel.
