Features
- ✅ Bot token authentication
- ✅ Direct message support
- ✅ Group channel support with mention policy
- ✅ User ID-based access control
- ✅ Message content intent support
Setup
Create a Discord bot
- Go to https://discord.com/developers/applications
- Click Create New Application
- Navigate to Bot section → Click Add Bot
- Copy the bot token (you may need to click Reset Token)
Enable intents
In the Bot settings, enable:
- MESSAGE CONTENT INTENT (required)
- SERVER MEMBERS INTENT (optional — only if using member-based allow lists)
Get your User ID
- Go to Discord Settings → Advanced
- Enable Developer Mode
- Right-click your avatar or username → Copy User ID
Invite the bot to your server
- In Developer Portal, go to OAuth2 → URL Generator
- Under Scopes, select:
bot - Under Bot Permissions, select:
Send MessagesRead Message History
- Copy the generated URL and open it in your browser
- Select a server and authorize the bot
Configuration Options
Enable the Discord channel
Bot token from Discord Developer Portal
List of Discord user IDs allowed to interact with the botExamples:
- Single user:
["123456789012345678"] - Multiple users:
["123456789012345678", "987654321098765432"]
Controls how the bot responds in group channels (servers):
"mention"(default) — Only respond when @mentioned"open"— Respond to all messages in channels
DMs always respond when the sender is in
allowFrom, regardless of policyGroup Chat Behavior
Understanding groupPolicy
Understanding groupPolicy
The Bot only responds when explicitly @mentioned in server channels.Bot responds to all messages in server channels (can be noisy).
groupPolicy setting only affects server channels, not direct messages.Mention mode (default)
Open mode
Direct messages
Always respond if sender is inallowFrom, regardless of groupPolicy.Troubleshooting
Bot doesn't respond
Bot doesn't respond
Common issues:
- MESSAGE CONTENT INTENT not enabled — Go to Bot settings and enable it
- User ID not in allowFrom — Verify your Discord user ID
- Bot token invalid — Reset token in Developer Portal
- Missing permissions — Ensure bot has Send Messages permission
nanobot gateway -vBot not responding in server channels
Bot not responding in server channels
- Check
groupPolicysetting:- If set to
"mention", you must @mention the bot - Change to
"open"to respond to all messages
- If set to
- Verify bot has Read Message History permission
- Ensure bot role is positioned correctly (above restricted roles)
Privileged intent error
Privileged intent error
If you see “Privileged intent provided is not enabled”:
- Go to Discord Developer Portal → Your Application → Bot
- Scroll to Privileged Gateway Intents
- Enable MESSAGE CONTENT INTENT
- Save changes and restart gateway
Bot appears offline
Bot appears offline
- Verify the bot token is correct
- Check internet connectivity
- Restart the gateway:
nanobot gateway - Check Discord API status: https://discordstatus.com/
Complete Example
Full configuration with all options:Related Pages
Configuration Overview
Learn about channel configuration
Security Settings
Set up access control