Discord
Your AI assistant, right in Discord
OpenClaw Discord Integration
Bring your AI assistant into Discord — the messaging hub for developers, creators, and communities. OpenClaw connects as a Discord bot, giving you and your team instant AI access without leaving the platform.
Setup
Step 1: Create a Discord App
- Go to discord.com/developers/applications
- Click "New Application" — name it (e.g. "My Assistant")
- Go to the Bot section → click "Reset Token" — save the token securely
- Under Privileged Gateway Intents, enable:
- MESSAGE CONTENT INTENT (required)
Step 2: Configure OpenClaw
channels: discord: enabled: true botToken: "YOUR_DISCORD_BOT_TOKEN" allowedServers: - "YOUR_SERVER_ID" allowedChannels: - "CHANNEL_ID_1" - "CHANNEL_ID_2"Step 3: Invite the Bot
- In Developer Portal → OAuth2 → URL Generator
- Scopes:
bot - Permissions: Send Messages, Read Message History, Use Slash Commands
- Copy the URL → open in browser → select server
Step 4: Start OpenClaw
openclaw gateway startBot comes online. Mention it with @YourBot or use slash commands.
Slash Commands
| Command | What it does |
|---|---|
/ask [question] | Ask the AI anything |
/summarize | Summarize recent messages |
/task [description] | Create a task |
/brief | Morning briefing |
Permission Control
channels: discord: allowedChannels: - "CHANNEL_ID" # only respond here allowedRoles: - "ROLE_ID" # only these roles can interact ignoredChannels: - "CHANNEL_ID" # never respond hereUse Cases
- Community Q&A — Answer common questions automatically in dev or product communities
- Team workflows — Create tickets, pull docs, run tasks from chat
- Personal access — DM your bot from any device as a personal assistant
Troubleshooting
Bot not responding? Check MESSAGE CONTENT INTENT is on in Developer Portal, and that the bot was invited with the correct permissions.
Rate limits? Discord allows 10 messages per 10 seconds per channel. OpenClaw handles this automatically.
Features
Slash commands
Use /ask, /summarize, /task and custom commands for structured interactions
Channel permissions
Control exactly which channels and roles can interact with your assistant
DM support
Chat privately with your assistant via Discord direct messages
Multi-server
Run the same assistant across multiple Discord servers simultaneously
File processing
Upload documents or images for your assistant to analyze
Real-time responses
Instant responses with typing indicators for a natural feel
Use Cases
Community Q&A
Automatically answer common questions in developer or product communities
Team productivity
Create tickets, pull documentation, and run workflows from chat
Personal assistant
Access your AI from any device via Discord DM
Knowledge base
Instant answers about your product or service from structured docs
Setup Guide
Requirements
- ✓Discord account
- ✓Discord server with Manage Server permission (for server bots)
- ✓OpenClaw running on a server or Mac
Create a Discord Application
Go to discord.com/developers/applications and click 'New Application'. Give it a name like 'OpenClaw Assistant'. This creates your app container.
Create the Bot User
In your application, go to the 'Bot' tab and click 'Add Bot'. This creates the actual bot user that will appear in your server. Customize the username and avatar here.
Copy the Bot Token
Click 'Reset Token' to generate a new token. Copy and save it securely — you'll need this for OpenClaw config. Never share this token publicly.
Enable Privileged Intents
Still in the Bot tab, scroll to 'Privileged Gateway Intents'. Enable 'Message Content Intent' (required to read messages), 'Server Members Intent' (for role-based access), and 'Presence Intent' (optional, for status features).
Configure Bot Permissions
Go to OAuth2 > URL Generator. Select 'bot' and 'applications.commands' scopes. For permissions, select: Send Messages, Read Message History, Read Messages/View Channels, Add Reactions, Attach Files, Embed Links, Use Slash Commands, and Create Public Threads.
Invite to Your Server
Copy the generated URL and open it in your browser. Select your server and authorize. The bot will appear in your member list (offline until OpenClaw starts).
Get Your User ID
Enable Developer Mode in Discord (Settings > App Settings > Advanced). Right-click your username and 'Copy User ID'. You'll need this for the allowlist.
Configure OpenClaw
Add the discord section to your OpenClaw config file with your bot token and allowed user IDs.
Start and Test
Run 'openclaw gateway start'. Your bot should come online. Send a message or use a slash command to verify it responds.
Configuration Example
discord:
botToken: \"MTIzNDU2Nzg5MDEyMzQ1Njc4.XXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXX\"
allowedUsers:
- \"123456789012345678\" # Your Discord user ID
- \"987654321098765432\" # Another allowed user
# Optional: restrict to specific channels
allowedChannels:
- \"111111111111111111\" # General channel
- \"222222222222222222\" # Bot commands channel
# Optional: restrict to specific roles
allowedRoles:
- \"333333333333333333\" # @Developer role
- \"444444444444444444\" # @Admin role
# Optional: customize bot behavior
prefix: \"!\" # Command prefix (default: mention only)
respondInThreads: true # Create threads for responses
splitLongMessages: true # Auto-split messages over 2000 charsLimitations
- ⚠️Message Content Intent required (Privileged Intent — needs verification for 100+ servers)
- ⚠️2000 character limit per message (auto-split for longer responses)
- ⚠️Rate limits apply for high-volume servers (can be mitigated with proper configuration)
Frequently Asked Questions
What is the Message Content Intent and why do I need it?
The Message Content Intent is a Privileged Intent that allows bots to read message content. Without it, your bot can only see messages where it's directly mentioned or in DMs. For a conversational AI, this is essential. Discord requires verification for bots in 100+ servers using this intent.
Can the bot work in multiple servers?
Yes, one bot can be invited to unlimited servers. Use allowedUsers for user-based access, or allowedRoles for server-specific role-based access. Each server can have different roles with the same names.
What permissions does the bot need?
Minimum: Read Messages, Send Messages, Read Message History. Recommended additions: Add Reactions (for feedback), Attach Files (for sharing outputs), Embed Links (for rich responses), Create Public Threads (for organized conversations), Use Slash Commands (for command discovery).
How do I set up slash commands?
Slash commands are automatically registered when you enable 'applications.commands' scope during bot invite. OpenClaw registers commands like /ask on startup. Users see them in Discord's command menu when typing /.
Can I make the bot private?
Yes, in the Discord Developer Portal under your application's Bot settings, keep 'Public Bot' disabled. Only you can add the bot to servers. For extra security, use allowedUsers to restrict who can interact even within allowed servers.
How do rich embeds work?
OpenClaw automatically formats responses as Discord embeds when appropriate — code blocks get syntax highlighting, long responses are structured with fields, and errors show distinct formatting. You can customize embed colors and styles in config.
What's the message length limit?
Discord limits messages to 2000 characters. OpenClaw automatically splits longer responses into multiple messages, preserving code blocks and formatting. For very long outputs, consider using file attachments or threads.
Can I use the bot in DMs only?
Yes, the bot works in DMs without any server invite. Users on the allowlist can DM the bot directly for private conversations. No server permissions needed.
How do I restrict access by role?
Add role IDs to allowedRoles in your config. Only users with at least one of those roles can interact with the bot. Get role IDs by enabling Developer Mode and right-clicking the role.
Why is my bot showing as offline?
The bot appears offline until OpenClaw's gateway is running. Start it with 'openclaw gateway start'. If it's still offline, check your bot token is correct and the gateway logs for connection errors.
Can the bot read all channels?
The bot can only read channels where it has Read Messages permission. Use Discord's role permissions or channel overrides to control visibility. Private channels need explicit bot access.
How do I handle rate limits?
Discord rate limits are per-channel and per-user. For high-volume servers, configure cooldowns in OpenClaw, use threads to consolidate conversations, or set up dedicated bot channels. OpenClaw handles rate limits gracefully with automatic retry.
Does it work with Discord bots from other platforms?
Yes, OpenClaw's Discord bot works alongside any other bots. Each bot uses its own token and operates independently. You can have moderation bots, music bots, and OpenClaw all in the same server.
Can I customize the bot's status message?
Yes, configure a custom presence in your OpenClaw config. The bot can show 'Playing', 'Watching', 'Listening to', or 'Competing in' status with custom text.
What happens if my server reaches 100+ members?
For bots in 100+ servers, Discord requires verification to use Message Content Intent. You'll need to verify your bot through Discord's application process. For private/personal bots in fewer servers, no verification needed.
🔥 Your AI should run your business, not just answer questions.
We'll show you how.Free to join.
Related Integrations
📚 Learn More
Discord Bot Setup — OpenClaw Integration Guide
Complete guide to setting up Discord as a channel for OpenClaw. Covers bot creation, permissions, authorization errors, slash commands, duplicate messages, per-channel configuration, and credential storage.
OpenClaw Discord: AI Bot for Your Server
Add an AI assistant to your Discord server. Setup guide, features, and configuration options.
How to Connect Gmail to Your AI Assistant (Complete Integration Guide)
Turn Gmail into an AI-powered inbox. Summarize threads, draft replies, auto-categorize messages, and search your email with natural language.
Tabnine vs GitHub Copilot
Privacy-first AI coding vs ecosystem integration
🐙 Your AI should run your business.
Weekly live builds + template vault. We'll show you how to make AI actually work.Free to join.
Join Vibe Combinator →