Discord

Add your bot to Discord using the official integration.

The official Discord integration allows users to chat with your bot in Discord servers, threads, and direct messages.

Setup

Install the integration in Botpress

First, install the integration to your bot:

  1. In Botpress Studio, select Explore Hub in the upper-right corner.
  2. Search for the Discord integration.
  3. Select Install Integration.

In the Configuration menu, you should see one field:

  • Bot Token

Leave it empty for now—you’ll come back to it after completing the setup in Discord.

Create a Discord application

Next, create a Discord application:

  1. Go to the Discord Developer Portal and sign in.
  2. Select New Application in the top-right corner.
  3. Give your application a name and select Create.

Create a bot user

Now, create a bot user for your application:

  1. In your application’s left sidebar, select Bot.
  2. Under the bot’s username, you can optionally set a custom avatar and display name.
  3. Under Privileged Gateway Intents, enable the following:
    • Server Members Intent
    • Message Content Intent
  4. Select Save Changes.

Copy your bot token

Next, copy your bot’s token:

  1. Still on the Bot page, below Token, select Reset Token (or Copy if a token is already visible).
  2. Confirm the reset if prompted.
  3. Copy the token and store it somewhere safe—you will not be able to see it again.

Invite the bot to your server

Now, invite the bot to your Discord server:

  1. In the left sidebar, select OAuth2 > OAuth2 URL Generator.
  2. Under Scopes, select:
    • bot
    • applications.commands
  3. Under Bot Permissions, select the permissions your bot requires. At minimum:
    • View Channels
    • Send Messages
    • Create Public Threads
    • Create Private Threads
    • Send Messages in Threads
    • Pin Messages
    • Attach Files
    • Read Message History
    • Add Reactions
    • Create Polls
  4. Copy the generated URL at the bottom of the page and open it in your browser.
  5. Select the server you want to add the bot to and select Authorize.

Configure the integration in Botpress

In your Botpress integration configuration, click “Connect with OAuth”, then follow the instructions in the wizard to fill out the following fields:

  1. In the integration’s Bot Token field, paste your Discord bot token.
  2. Select Save Configuration.

Options

The Discord integration’s Configuration menu offers a few additional options:

Custom display name / avatar

  • Fill in the Bot Name field to display a custom name as the sender in Discord conversations.
  • Fill in the Bot Avatar URL field to set a custom image as the bot’s Discord avatar.

Cards

Add Member Role

Add a role to a guild member

inputobject

Add Reaction

Create a reaction for the message

inputobject

Ban User

Ban a user from a guild

inputobject

Call API

Send a raw HTTP request to any Discord API endpoint

inputobject
outputobject

Create Channel

Creates a new channel in a guild.

inputobject
outputobject

Create Poll

Creates a poll in a Discord channel.

inputobject
outputobject

Create Role

Create a new role in a guild

inputobject
outputobject

Delete Channel

Deletes a channel from a guild.

inputobject

Delete Reaction

Delete a reaction the current user has made for the message

inputobject

Delete Role

Delete a role from a guild

inputobject

End Poll

Immediately end a poll in a channel

inputobject
outputobject

Get Channel Pins

Returns all pinned messages in the channel.

inputobject
outputobject

Get Guild

Returns the guild object for the given ID

inputobject
outputobject

Get Guild Channels

Returns a list of guild channel objects. Does not include threads.

inputobject
outputobject

Get Guild Member

Returns a guild member object for the specified user.

inputobject
outputobject

getOrCreateChannelConversation

Gets or Creates a botpress conversation from a discord channel

inputobject
outputobject

Get or Create a User

Proactively create a user from a bot

inputobject
outputobject

List Guild Members

Returns a list of guild member objects that are members of the guild.

inputobject
outputobject

Pin Message

Pins a message in a channel.

inputobject

Remove Member Role

Remove a role from a guild member

inputobject

startTypingIndicator

inputobject

stopTypingIndicator

inputobject

Unban User

Remove a ban for a user from a guild

inputobject

Unpin Message

Unpins a message in a channel.

inputobject

Triggers

Guild Member Added

Triggered when a user joins a guild

payloadobject

Message Poll Vote Changed

Triggered when a user adds or removes their vote on a poll

payloadobject

Reaction Changed

Triggered when a user adds or removes a reaction on a message

payloadobject