Discord Bot Joins Server But Reads No Messages — Missing Intents
// Your OpenClaw Discord bot shows online, responds to slash commands you registered months ago, but completely ignores normal channel messages and DMs. This is the classic Privileged Gateway Intent gap: Discord hides message body content from bots unless Message Content Intent is enabled in the Developer Portal. Some setups also need Server Members Intent for name resolution or role-based routing. The bot is connected — Discord just never delivers the events OpenClaw needs. This unofficial guide covers enabling intents, generating a fresh OAuth invite with bot + applications.commands scopes, updating openclaw.json channel config, and restarting the gateway so message handlers actually fire.
🔍 Is This Your Issue?
✅ Fix 1 — Enable Privileged Gateway Intents in Portal
# Browser: discord.com/developers/applications # 1. Select your bot application # 2. Bot → Privileged Gateway Intents # 3. Enable: # ☑ MESSAGE CONTENT INTENT (required) # ☑ SERVER MEMBERS INTENT (if using roles/names) # 4. Save Changes
# Optional: note your Application ID (Client ID) # Bot tab → Token → Reset Token only if compromised # Do NOT share token; set in ~/.openclaw/.env: # DISCORD_BOT_TOKEN=your_token_here
✅ Fix 2 — Regenerate Bot Invite With Correct Scopes
# Generate invite URL (replace CLIENT_ID) https://discord.com/api/oauth2/authorize?client_id=CLIENT_ID&permissions=2147875840&scope=bot%20applications.commands # permissions include Send Messages, Read History, etc. # scope must include bot AND applications.commands
# Re-add bot to server OR kick and re-invite # OAuth2 → URL Generator in portal is equivalent # Required scopes: bot, applications.commands # Bot permissions: Read Messages, Send Messages, # Read Message History, Embed Links, Attach Files
✅ Fix 3 — Update Config & Restart Gateway
// ~/.openclaw/openclaw.json — discord channel
{
"channels": {
"discord": {
"enabled": true,
"tokenEnv": "DISCORD_BOT_TOKEN",
"guilds": {
"YOUR_GUILD_ID": {
"channels": ["YOUR_CHANNEL_ID"]
}
}
}
}
}openclaw doctor openclaw gateway restart # Send test message in allowed channel # Watch logs: openclaw logs --follow | grep -i discord
Toggling intents in the portal does not retroactively fix an old guild authorization. Kick the bot or use a fresh invite URL with the same client ID, then verify MESSAGE_CREATE events appear in gateway debug logs before testing agent replies.
- • Enable Message Content Intent before first production invite — document the portal URL in your runbook
- • Store the bot token only in ~/.openclaw/.env or openclaw.json — rotate if pasted into Discord support tickets
- • Use separate Discord applications for dev vs prod bots so intent experiments do not break live servers
- • After portal changes, always restart gateway and watch logs for GatewayIntentBits warnings
- • For 100+ server bots, verify Discord verified-bot requirements for privileged intents