Setup
You will need:
- A published bot
- A Discord account with permission to create applications
1
Install the integration in Botpress
First, install the integration to your bot:
- In Botpress Studio, select Explore Hub in the upper-right corner.
- Search for the Discord integration.
- Select Install Integration.
- Bot Token
2
Create a Discord application
Next, create a Discord application:
- Go to the Discord Developer Portal and sign in.
- Select New Application in the top-right corner.
- Give your application a name and select Create.
3
Create a bot user
Now, create a bot user for your application:
- In your application’s left sidebar, select Bot.
- Under the bot’s username, you can optionally set a custom avatar and display name.
- Under Privileged Gateway Intents, enable the following:
- Server Members Intent
- Message Content Intent
- Select Save Changes.
4
Copy your bot token
Next, copy your bot’s token:
- Still on the Bot page, below Token, select Reset Token (or Copy if a token is already visible).
- Confirm the reset if prompted.
- Copy the token and store it somewhere safe—you will not be able to see it again.
5
Invite the bot to your server
Now, invite the bot to your Discord server:
- In the left sidebar, select OAuth2 > OAuth2 URL Generator.
- Under Scopes, select:
botapplications.commands
- 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
- Copy the generated URL at the bottom of the page and open it in your browser.
- Select the server you want to add the bot to and select Authorize.
6
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:
- In the integration’s Bot Token field, paste your Discord bot token.
- Select Save Configuration.
Your Discord integration is ready—users can now chat with your Botpress bot in Discord servers, threads, and direct messages.
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.
The avatar URL must be publicly accessible. Supported formats include PNG, JPG, and GIF.