Discord Channel
Discord integration with full support for guilds, threads, and rich embeds.
Overview
| Property | Value |
|---|---|
| Package | @openclawos/discord |
| API | discord.js |
| Features | Guilds, threads, embeds, reactions |
| Status | Production Ready |
Quick Start
1. Create a Bot
- Go to Discord Developer Portal
- Create a new application
- Go to Bot settings, create a bot
- Copy the bot token
- Enable required intents (Message Content)
2. Generate Invite URL
In OAuth2 > URL Generator:
- Scopes:
bot,applications.commands - Bot Permissions:
Send Messages,Read Message History,Add Reactions
3. Configure
Or edit config.json:
4. Start
Configuration
Basic
{
"channels": {
"discord": {
"enabled": true,
"token": "MTIzNDU2Nzg5MDEyMzQ1Njc4OQ.GAbCdE.xxxxx"
}
}
}
Advanced Options
{
"channels": {
"discord": {
"enabled": true,
"token": "...",
"allowedGuilds": ["123456789012345678"],
"allowedChannels": ["987654321098765432"],
"respondToMentions": true,
"respondToDMs": true
}
}
}
| Option | Type | Description |
|---|---|---|
token |
string | Bot token |
allowedGuilds |
string[] | Whitelist of guild IDs |
allowedChannels |
string[] | Whitelist of channel IDs |
respondToMentions |
boolean | Respond to @mentions (default: true) |
respondToDMs |
boolean | Respond to DMs (default: true) |
Required Intents
In the Discord Developer Portal, enable:
- Message Content Intent (Privileged) - Required to read message text
- Server Members Intent (Privileged) - Optional, for member info
Bot Permissions
Minimum permissions:
- View Channels
- Send Messages
- Read Message History
- Add Reactions
Recommended:
- Embed Links
- Attach Files
- Use External Emojis
Features
Guild Channels
Bot responds to:
- Direct @mentions
- Replies to bot messages
Direct Messages
Bot responds to all DMs by default.
Threads
Full thread support:
- Creates threads for long conversations
- Responds in existing threads
Rich Embeds
Responses can include embeds:
- Titles and descriptions
- Color-coded messages
- Links and images
Session Keys
Format: discord:{guild_id}:{channel_id}
Examples:
discord:123456789012345678:987654321098765432- Guild channeldiscord:dm:123456789012345678- Direct message
Troubleshooting
"Message Content Intent required"
- Go to Discord Developer Portal
- Select your application
- Go to Bot settings
- Enable "Message Content Intent"
Bot not responding in server
- Check bot has permission to view and send in the channel
- Run
openclaw doctorto diagnose issues - Verify
allowedGuildsdoesn't exclude the server
Rate limited
Discord has strict rate limits. The app handles these automatically.