OpenClaw Discord Bot Setup: Complete Integration Guide
Complete guide to setting up OpenClaw as a Discord bot. Learn how to create a Discord application, configure bot permissions, set up multi-user support, and run multiple instances.
Quick Answer
Set up OpenClaw Discord bot: Create a Discord application, create a bot, get the bot token, invite bot to server with permissions, run `openclaw integrations discord`, enter token, and start using. Supports multi-user and multiple instances.
Introduction
Discord is perfect for team collaboration and community servers, and OpenClaw’s Discord integration makes it easy to add an AI assistant to your server. With support for multi-user interactions, slash commands, and server-wide deployment, OpenClaw can become a valuable member of your Discord community.
This guide covers everything you need to set up OpenClaw as a Discord bot, from creating the application to configuring advanced features.
For other chat app integrations, see our guides:
Why Discord?
Discord offers excellent features for AI bots:
- Slash Commands — Modern command interface
- Multi-User Support — Handle multiple users simultaneously
- Server Integration — Works across entire servers
- Rich Embeds — Beautiful formatted messages
- Thread Support — Organize conversations
- Permissions System — Fine-grained access control
Prerequisites
Before setting up Discord integration:
- OpenClaw Installed — See installation guide
- OpenClaw Configured — Run
openclaw onboardto set up your AI model - Discord Account — Active Discord account
- Server Access — Permission to add bots to a Discord server
- Bot Token — You’ll create this in the next step
Step 1: Create a Discord Application
Create Application
- Go to Discord Developer Portal: discord.com/developers/applications
- Click “New Application”
- Enter a name (e.g., “OpenClaw Assistant”)
- Click “Create”
Create Bot
- Go to “Bot” section in the left sidebar
- Click “Add Bot”
- Click “Yes, do it!” to confirm
- Copy the bot token — Click “Reset Token” if needed, then copy:
MTAxMjM0NTY3ODkwMTIzNDU2Nzg5MA.AbCdEf.GhIjKlMnOpQrStUvWxYzAbCdEfGhIjKlMnOpQr
Important: Keep your bot token secret! Never share it publicly.
Configure Bot Settings
In the Bot section:
- Username — Set bot display name
- Icon — Upload bot avatar
- Public Bot — Uncheck if you want private bot
- Requires OAuth2 Code Grant — Leave unchecked
- Message Content Intent — Enable this (required for message content)
- Server Members Intent — Enable if you need member info
- Presence Intent — Enable if you want presence updates
Save Changes after enabling intents.
Step 2: Invite Bot to Server
Generate Invite URL
-
Go to “OAuth2” → “URL Generator”
-
Select Scopes:
- ✅
bot - ✅
applications.commands(for slash commands)
- ✅
-
Select Bot Permissions:
- ✅ Send Messages
- ✅ Read Message History
- ✅ Use Slash Commands
- ✅ Embed Links
- ✅ Attach Files
- ✅ Read Messages/View Channels
- ✅ Manage Messages (optional, for moderation)
- ✅ Add Reactions (optional)
-
Copy the generated URL at the bottom
Invite to Server
- Open the invite URL in your browser
- Select your server from the dropdown
- Click “Authorize”
- Complete CAPTCHA if prompted
Your bot should now appear in your server’s member list (offline initially).
Step 3: Configure OpenClaw
Run Integration Setup
Start the Discord integration:
openclaw integrations discord
Or use the general integrations command:
openclaw integrations
# Select Discord from the menu
Enter Bot Token
When prompted, paste your bot token:
Enter your Discord bot token: MTAxMjM0NTY3ODkwMTIzNDU2Nzg5MA.AbCdEf...
OpenClaw will verify the token and connect to Discord.
Verify Connection
You should see:
✓ Discord bot connected successfully!
Bot username: OpenClaw#1234
Servers: Your Server Name
Check your Discord server—the bot should now show as online.
Step 4: Start Using the Bot
Slash Commands
Discord uses slash commands. Type / in any channel to see available commands:
/openclaw— Start a conversation with OpenClaw/help— Get help/email— Check email (if configured)/calendar— View calendar/tasks— List tasks
Direct Messages
You can also DM the bot directly:
- Right-click bot in member list
- Select “Message”
- Send a message like “Hello, can you help me?”
Channel Mentions
Mention the bot in a channel:
@OpenClaw can you check my email?
Advanced Features
Slash Command Registration
OpenClaw automatically registers slash commands. To manually register:
openclaw integrations discord --register-commands
Custom Slash Commands
Create custom slash commands:
openclaw config set discord.commands.email.description "Check your email inbox"
openclaw config set discord.commands.calendar.description "View your calendar"
Multi-User Support
OpenClaw handles multiple users simultaneously:
- Separate contexts — Each user has their own context
- User-specific memory — Remembers each user’s preferences
- Concurrent conversations — Handles multiple users at once
Configure user limits:
openclaw config set discord.maxUsers 100
Thread Support
OpenClaw can create threads for conversations:
openclaw config set discord.threads.enabled true
openclaw config set discord.threads.autoCreate true
This keeps conversations organized in busy channels.
Rich Embeds
OpenClaw sends beautiful formatted messages:
openclaw config set discord.embeds.enabled true
openclaw config set discord.embeds.color "#00ff00"
Reaction Buttons
Add reaction buttons for quick actions:
openclaw config set discord.reactions.enabled true
Users can react to messages for quick responses.
Configuration Options
Server-Specific Settings
Configure settings per server:
openclaw config set discord.servers.SERVER_ID.channel "general"
openclaw config set discord.servers.SERVER_ID.prefix "!"
Response Formatting
Configure message formatting:
openclaw config set discord.format "markdown"
Options:
markdown— Rich formattingplain— Plain textembed— Discord embeds
Rate Limiting
Control message rate:
openclaw config set discord.rateLimit 30
Limits to 30 messages per minute per user.
Privacy Settings
Configure privacy:
openclaw config set discord.privacy.dmOnly false
openclaw config set discord.privacy.allowedChannels ["general", "ai-assistant"]
Notification Settings
Control notifications:
openclaw config set discord.notifications.enabled true
openclaw config set discord.notifications.quietHours "22:00-08:00"
Running Multiple Instances
Why Multiple Instances?
You might want multiple OpenClaw instances for:
- Different servers — Separate instances per server
- Different models — Different AI models per instance
- Load balancing — Distribute load across instances
Setup Multiple Instances
-
Create multiple Discord applications (one per instance)
-
Configure each instance:
openclaw config set instance.name "instance1" openclaw config set instance.port 3001 -
Run each instance:
openclaw --port 3001 --config instance1.json
Process Management
Use pm2 to manage multiple instances:
npm i -g pm2
# Start instance 1
pm2 start openclaw --name "openclaw-1" -- --port 3001
# Start instance 2
pm2 start openclaw --name "openclaw-2" -- --port 3002
pm2 save
pm2 startup
Troubleshooting
Bot Not Responding
If your bot doesn’t respond:
-
Check bot status:
openclaw status -
Verify token:
openclaw config get discord.token -
Check logs:
openclaw logs -
Verify intents — Ensure Message Content Intent is enabled in Discord Developer Portal
Token Invalid
If you see “token invalid” errors:
- Verify token — Check Discord Developer Portal
- Regenerate token — Reset token in Developer Portal
- Update token:
openclaw integrations discord
Bot Not Appearing Online
If bot shows as offline:
-
Check OpenClaw is running:
openclaw status -
Restart OpenClaw:
openclaw restart -
Verify connection:
openclaw test discord
Slash Commands Not Appearing
If slash commands don’t appear:
-
Wait a few minutes — Commands can take time to register
-
Manually register:
openclaw integrations discord --register-commands -
Check permissions — Ensure bot has “Use Slash Commands” permission
Rate Limiting
If you hit rate limits:
-
Increase rate limit:
openclaw config set discord.rateLimit 60 -
Check Discord limits — Discord has API rate limits
-
Use multiple instances — Distribute load
Permission Errors
If you see permission errors:
- Check bot permissions — Ensure bot has required permissions
- Check channel permissions — Bot needs access to channels
- Re-invite bot — Regenerate invite URL with correct permissions
Security Best Practices
Bot Token Security
-
Keep token secret — Never share publicly
-
Use environment variables:
export DISCORD_BOT_TOKEN="your-token" -
Rotate token — Regenerate if compromised in Developer Portal
Server Security
- Limit permissions — Only grant necessary permissions
- Restrict channels — Limit bot to specific channels
- User whitelist — Restrict to specific users:
openclaw config set discord.allowedUsers ["user1#1234", "user2#5678"]
Data Privacy
- Local processing — All messages processed locally
- No cloud storage — Unless explicitly configured
- Secure storage — Data stored in
~/.openclaw
Advanced Use Cases
Team Collaboration
Use OpenClaw in team servers:
- Task management — Assign and track tasks
- Calendar coordination — Schedule meetings
- Information retrieval — Quick answers for team
- Documentation — Answer questions about docs
Community Servers
Use in community servers:
- FAQ bot — Answer common questions
- Moderation — Assist with moderation
- Information — Provide server information
- Entertainment — Fun interactions
Personal Server
Use in personal server:
- Personal assistant — Manage tasks and calendar
- Email management — Check and respond to emails
- Productivity — Track todos and projects
Comparison with Other Platforms
Discord vs Telegram
- Discord — Better for servers, slash commands
- Telegram — Better for personal use, simpler
See our Telegram guide for comparison.
Discord vs Slack
- Discord — Free, better for communities
- Slack — Better for businesses, more integrations
See our Slack guide for details.
Next Steps
Now that Discord is connected:
- Explore Other Integrations — WhatsApp, Telegram, Slack
- Set Up Skills — Skills Library
- Configure Email — Gmail Integration
- Read FAQ — Common Questions
Conclusion
Discord integration provides excellent features for team collaboration and community servers. With slash commands, multi-user support, and server-wide deployment, OpenClaw can become a valuable member of your Discord community.
For more help, check our integrations page or FAQ. Happy automating with your Discord bot!
Need help?
Join the OpenClaw community on Discord for support, tips, and shared skills.
Join Discord →