Discord groupPolicy Explained: Why Your Bot Ignores Server Messages
A common question in the OpenClaw Discord: "My bot works in DMs but doesn't respond in server channels!" The culprit? Usually a misconfigured groupPolicy setting.
The Problem
One user recently asked for help after their bot stopped responding to server messages. The error in their logs was clear:
Invalid config at /data/.openclaw/openclaw.json:
- channels.discord.groupPolicy: Invalid option: expected one of "open"|"disabled"|"allowlist"
The issue? They'd tried setting groupPolicy: "allow" โ but that's not a valid option. The valid values are:
"open"โ Bot responds in all server channels"disabled"โ Bot only responds in DMs (default)"allowlist"โ Bot only responds in servers/channels you explicitly configure
Quick Fix: Allow All Servers
If you just want your bot to respond everywhere:
{
"channels": {
"discord": {
"groupPolicy": "allowlist",
"guilds": {
"YOUR_GUILD_ID": {
"requireMention": false,
"users": ["YOUR_USER_ID"]
}
}
}
}
}Recommended: Allowlist Specific Servers
For production use, lock it down to your server(s):
{
"channels": {
"discord": {
"groupPolicy": "allowlist",
"guilds": {
"YOUR_GUILD_ID": {
"requireMention": false,
"users": ["YOUR_USER_ID"]
}
}
}
}
}Replace YOUR_GUILD_ID with your actual Discord server ID (enable Developer Mode in Discord settings, then right-click your server to copy the ID).
Bonus: Restrict to Specific Users
Want only YOU to be able to use the bot in your server?
{
"channels": {
"discord": {
"groupPolicy": "allowlist",
"guilds": {
"YOUR_GUILD_ID": {
"requireMention": false,
"users": ["YOUR_USER_ID"]
}
}
}
}
}Pro tip: Use Discord user IDs, not usernames โ IDs don't change if someone renames their account.
Other Common Gotchas
1. Mention-gating
By default, guild messages require you to @mention the bot. Either:
- Always
@YourBotwhen messaging, OR - Set
requireMention: falsein your config
2. Message Content Intent
In the Discord Developer Portal, make sure Message Content Intent is enabled for your bot. Without it, Discord won't send message content to your bot.
3. Restart Required
After editing your config, restart the gateway:
openclaw gateway restartResources
Based on a question from the OpenClaw Discord #help channel. Got stuck? Post there โ the community (and Krill ๐ฆ) are always happy to help.
Comments (0)
No comments yet. Be the first to comment!