Overview
The Discord integration is sandbox-native — your bot token is stored securely inside your isolated sandbox environment and never leaves it. Coral connects to Discord using your own bot application, giving you full control over the bot’s identity, permissions, and server access.Prerequisites
- A Coral account with an active sandbox
- A Discord account
- A Discord server where you have permission to add bots
Step 1: Create a Discord Application
- Go to the Discord Developer Portal.
- Click “New Application” and give it a name (e.g., “My AI Assistant”).
- Optionally, add a profile picture and description for your bot.
Step 2: Configure the Bot
- In the left sidebar, click “Bot”.
- Click “Reset Token” and copy the token. Save it somewhere safe — you will only see it once.
- Under “Privileged Gateway Intents”, enable the following:
- Message Content Intent — allows the bot to read message content
- Server Members Intent — allows the bot to see server members
Step 3: Set Bot Permissions and Invite to Server
- In the left sidebar, go to “OAuth2” > “URL Generator”.
- Under Scopes, select:
botapplications.commands
- Under Bot Permissions, select:
- View Channels
- Send Messages
- Read Message History
- Embed Links
- Attach Files
- Copy the generated URL at the bottom of the page.
- Open the URL in your browser and select the server you want to add the bot to.
- Click “Authorize”.
Step 4: Connect in Coral
- Open the Coral dashboard and go to the Integrations page.
- Click on the Discord card.
- Paste your bot token into the Bot Token field.
- Click “Connect”.
Step 5: Pair Your Discord Account
After the bot connects, you need to pair your Discord account so the assistant knows who you are:- Open Discord and go to the server where you invited the bot.
- Click on the bot’s name to open a DM, then send it any message (e.g., “Hello”).
- The bot will reply with an 8-character pairing code (e.g.,
KVM9A75Y). - Go back to the Coral Integrations page and paste the code into the Pairing Code field.
- Click “Approve”.
You can skip pairing and do it later, but the bot will not respond to your messages until pairing is completed.
Managing Your Discord Integration
Once connected, the Discord card on the Integrations page shows your bot’s status:- Connected — The bot is online and responsive.
- Configured but not connected — The token is saved but the bot cannot connect (e.g., token was revoked). Click “Reconfigure” to enter a new token.
Troubleshooting
| Problem | Solution |
|---|---|
| Bot shows “configured but not connected” | Your token may be invalid or revoked. Reset the token in the Discord Developer Portal and reconfigure. |
| Bot is online but doesn’t respond | Make sure you completed the pairing step. Also verify that Message Content Intent is enabled. |
| Bot can’t see messages in a channel | Check that the bot has View Channels and Read Message History permissions in that channel. |
| ”Invalid bot token” error | Ensure you copied the full token. Bot tokens look like MTIzNDU2Nzg5MDEyMzQ1Njc4OQ... — they are long base64 strings. |
Security
- Your bot token is stored exclusively inside your sandbox’s configuration file (
~/.openclaw/openclaw.json). - The token never passes through Coral’s servers — it is sent directly from the Coral UI to your sandbox via an authenticated gateway RPC.
- If you back up and restore your sandbox, the Discord configuration is preserved in the backup.