Discord
Status: ✅ Supported (OpenClaw only)
Discord channel allows your agent to operate as a bot in Discord servers.
Features
- Server bot: Responds to messages in Discord channels
- Allowlisting: Control which users can interact
- Channel restrictions: Limit to specific channels
- Thread support: Conversations in threads
- Rich formatting: Markdown, embeds, reactions
Setup
1. Create Discord Application
- Go to Discord Developer Portal
- Click New Application
- Name it (e.g., "My Claw Agent")
- Go to Bot section
- Click Add Bot
- Enable Message Content Intent (required for reading messages)
- Copy the Token (starts with
MTA...or similar)
2. Invite Bot to Server
- Go to OAuth2 → URL Generator
- Select scopes:
botapplications.commands(optional, for slash commands)
- Select bot permissions:
- Send Messages
- Read Message History
- Embed Links
- Add Reactions
- Use External Emojis
- Read Messages/View Channels
- Copy the generated URL
- Open URL in browser and select your server
3. Configure Channel in Clawrium
During agent onboarding:
clm agent configure my-agent
When prompted for channels:
- Select Discord
- Enter bot token (from step 1)
- Enter your Discord server (guild) ID:
- Enable Developer Mode in Discord (Settings → Advanced)
- Right-click server name → Copy Server ID
- Enter channel ID:
- Right-click channel → Copy Channel ID
- Enter your user ID (for auto-approve):
- Right-click your username → Copy User ID
4. Start Agent
clm agent start my-agent
The bot will come online in your Discord server.
Configuration Details
The Discord configuration includes:
{
"discord": {
"enabled": true,
"token": {
"source": "env",
"id": "DISCORD_BOT_TOKEN"
},
"allowFrom": ["USER_ID_1", "USER_ID_2"],
"groupPolicy": "allowlist",
"guilds": {
"GUILD_ID": {
"users": ["USER_ID_1"],
"channels": {
"CHANNEL_ID": {
"allow": true
}
}
}
}
}
}
Security
- Bot token is stored securely (not in plain text)
- Allowlist controls who can trigger the agent
- Channel restrictions limit where it responds
- Consider creating a dedicated channel for the bot
Usage
Once running, interact with the bot by:
- Mentioning it:
@MyBot analyze this code - Sending messages in allowed channels
- The bot will respond in the same channel
Troubleshooting
"Bot not responding"
- Check bot is online in Discord
- Verify bot token is correct
- Check allowlist includes your user ID
- Ensure channel is in allowed channels list
"Token invalid"
- Regenerate token in Discord Developer Portal
- Re-run:
clm agent configure <name> --stage channels
"Missing permissions"
- Re-invite bot with correct permissions
- Check bot role has required permissions in server
"Message intent required"
- Enable Message Content Intent in Bot settings
- This is required for the bot to read message content