Discord
Learn how to connect your agent to Discord.
Creating a Discord Application
First, you'll need to create a new application in the Discord Developer Portal. This is the foundation for your Discord bot.
- Navigate to the Discord Developer Portal
- Click the "New Application" button in the top right corner
Configuring Your Bot's Identity
Choose a memorable and appropriate name for your bot. This name will be displayed to users in Discord servers.
- Enter a unique name for your bot
- Click "Create" to proceed
Obtaining the Application ID
The Application ID is a unique identifier for your bot that you'll need for configuration.
- Go to the "OAuth2" tab in the left sidebar
- Locate and copy the "Client ID" - this will be your
DISCORD_APPLICATION_ID
Getting Your Bot Token
The bot token is like a password that allows your agent to connect to Discord. Keep this token secure and never share it publicly.
- Navigate to the "Bot" tab in the left sidebar
- Click "Reset Token" and copy the generated token - this is your
DISCORD_API_TOKEN
Setting Bot Permissions
Your bot needs specific permissions to function properly in Discord servers. Configure these carefully to ensure security.
- Scroll down on the "Bot" tab
- Enable the necessary permissions as shown in the image below
- Make sure to save your changes
Configuring Agent Secrets
Add the necessary credentials to your agent's configuration to enable Discord connectivity.
- Navigate to your agent's settings
- Add both the
DISCORD_APPLICATION_ID
andDISCORD_API_TOKEN
- Save your changes
Installing the Bot
The final step is to add your bot to your Discord server. Make sure you have the appropriate server permissions to do this.
- Click the installation link generated in your Discord application
- Select the server where you want to add the bot
- Review and approve the requested permissions
Setup Complete!
Congratulations! Your agent is now successfully connected to Discord and ready to interact with users. You can test it by sending a message in your server.