Log in

Add your bot to a Discord server

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

Once it's connected with the Gateway transport, the bot can also:

ℹ️

Standard, Pro and Enterprise

The Discord channel is included on the Standard, Pro and Enterprise plans.

Who can do this: team owners and admins.

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 commandYesYes
Reply to @mentions in channelsYesNo
Reply to direct messagesYesNo
Keep context in threadsYesNo
Read recent channel messages when @mentionedYesNo
Needs the Message Content IntentYesNo

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

Create a Discord application

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

  1. Go to the Discord developer portal 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
  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
  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
    The Token section on the Bot page in the Discord developer portal with the Reset Token button
  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
  7. Click Save. Do this before the next step.
  8. Under Integration URL, copy the Interactions endpoint URL and paste it into Interactions Endpoint URL on the General Information page in Discord. Save the changes in Discord. Slash commands and buttons need it.
    The Interactions Endpoint URL field in the Discord developer portal with a Chat Thing commands URL pasted in
  9. 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
    Discord's Success screen confirming the app has been authorised and added to the server

Give an existing bot new permissions

Newer features, such as removing messages, need permissions a bot added earlier doesn't have. To update them, click Add to Discord in the channel settings again, choose the server the bot is already in and authorise it. Discord updates the bot's role; its settings and conversations stay as they are.

You can also change the permissions yourself in Discord, under Server Settings > Roles > the bot's role.

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

For older or cross-channel history on demand, add the Discord Get Channel History power-up. To let the bot post in other channels, react to messages or start threads and forum posts, add Discord Send Message, Discord Add Reaction or Discord Create Thread. See Discord power-ups.

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.

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 shows "Invalid OAuth2 redirect_uri"

You're using an Add to Discord link from before redirects were removed. Reload the channel settings in Chat Thing and click Add to Discord 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.
  • 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.

Last updated