Discord Integration Guide
Connect your AI agent to Discord for server messaging, DM management, role-based responses, and community engagement using a bot token from the Discord Developer Portal.
What your agent can do
Full Discord capabilities through the Bot API.
Server messaging
Send and receive messages in any text channel the bot has access to. Your agent can participate in discussions, answer questions, and share updates.
DM management
Handle direct messages with server members. Your agent can provide private support, send notifications, and maintain 1:1 conversations.
Role-based responses
Respond differently based on user roles. Your agent can provide admin-only information, member-specific content, or public responses depending on who asks.
Voice channel info
Access voice channel metadata like who is connected and channel status. Your agent can report on voice activity without joining the call.
Prerequisites
What you need before connecting Discord to your agent.
- A Discord server where you have administrator or manage-server permissions
- A Discord Developer account (free at discord.com/developers)
- A bot application created in the Discord Developer Portal
- A ClawTrust agent on any plan (Starter, Pro, or Enterprise)
Step-by-step setup
Connect Discord to your agent in about 10 minutes.
Create a Discord application
Go to discord.com/developers/applications and click "New Application". Name it after your agent (e.g., "Sales Bot"). This creates the app container for your bot.
Create the bot user and copy the token
In your application settings, go to the Bot section. Click "Add Bot" to create a bot user. Under Token, click "Copy" to get your bot token. Keep this secret.
Configure bot permissions
In the Bot section, enable "Message Content Intent" under Privileged Gateway Intents. This allows the bot to read message content. Also enable "Server Members Intent" if you need role-based responses.
Invite the bot to your server
Go to OAuth2 > URL Generator. Select "bot" scope, then choose permissions: Send Messages, Read Messages/View Channels, Add Reactions, Manage Messages (optional). Copy the generated URL and open it to invite the bot to your server.
Add the credential in ClawTrust
In your agent's dashboard, go to Credentials > Add Credential. Select "API Key (Bearer)" as the type. Paste the bot token as the API key. Set allowed domains to discord.com.
Test the connection
Click "Test" on the credential card. Then send a message in your Discord server mentioning the bot. Your agent should respond within a few seconds.
Credential details
Reference for the credential configuration fields.
Security note
Your bot token is encrypted with AES-256-GCM before storage. The credential proxy restricts all outbound API calls to *.discord.com domains only. You can regenerate the bot token in the Discord Developer Portal at any time to revoke access. The bot only accesses channels it has been explicitly invited to.
Example actions
Things you can ask your agent to do once Discord is connected.
Answer community questions in #general based on your documentation
Send a welcome DM to new members who join the server
Post daily metrics and updates in #announcements
Respond to support requests in #help with troubleshooting steps
React with emoji to acknowledge bug reports in #bugs
Ready to bring your agent to Discord?
Bot setup in 10 minutes. Encrypted tokens, domain-locked proxy, full audit logging.