Discord Setup Guide
Add OpenClaw to your Discord server. About 5 minutes.
Prerequisites
- β OpenClaw installed and running (Quick Start)
- β A Discord account
- β A Discord server where you have Manage Server permission
- β About 5 minutes
Create a Bot
- Go to the Discord Developer Portal
- Click New Application β give it a name β Create
- In the left sidebar, go to Bot
- Click Reset Token β confirm β copy the token
The token is only shown once! Copy it right away and save it somewhere safe.
Turn On Message Content
Still on the Bot page, scroll down to Privileged Gateway Intents:
- Turn ON the Message Content Intent toggle
- Click Save Changes
If you skip this, your bot will see messages arrive but can't read what they say. This is the most common setup mistake.
Invite Bot to Your Server
Generate an invite link with the right permissions:
- Go to OAuth2 β URL Generator in the left sidebar
- Under Scopes, check:
botandapplications.commands - Under Bot Permissions, check:
View ChannelsSend MessagesRead Message History
- Copy the URL at the bottom and open it in your browser
- Pick your server β Authorize
You need Manage Server permission on the server to add bots.
Configure OpenClaw
Run the setup wizard and paste your bot token:
openclaw init Select Discord when prompted, then paste the token from Step 1.
Or edit the config file manually
Add this to ~/.openclaw/config.yaml:
channels:
discord:
token: "YOUR_DISCORD_BOT_TOKEN"
enabled: true Start & Test
Start the gateway:
openclaw gateway start Open Discord and mention your bot in any channel:
Success! Your Discord bot is now connected to OpenClaw.
Bonus: DMs & Channels
By default, the bot responds when mentioned with @YourBot. You can also DM the bot directly β just find it in the server member list and send a message.
Want the bot to respond in specific channels without being mentioned? Check the advanced configuration for auto-respond settings.
Troubleshooting
Bot is online but doesn't respond
Make sure Message Content Intent is turned on (Step 2). This is the #1 issue.
Bot not showing in the server
Re-check the invite URL. Make sure you selected both bot and applications.commands scopes.
Invalid token error
Go back to the Developer Portal β Bot β Reset Token to generate a new one. Update your config.
Bot responds slowly
This is normal for the first message. Subsequent messages should be faster.