Want an AI bot in your Discord server that actually remembers conversations, uses tools, and runs 24/7? OpenClaw makes it possible — and connecting it to Discord takes just a few minutes.
This guide walks you through every step: creating the Discord application, getting your bot token, configuring OpenClaw, and going live. Whether you're self-hosting or using Ampere.sh, the process is the same. Also check out our guides for Telegram and WhatsApp.
What You'll Need Before Starting
- A Discord account with access to a server where you have admin/manage permissions
- An OpenClaw instance — either Ampere.sh (managed) or self-hosted
- An LLM API key — Anthropic (Claude), OpenAI (GPT-4), Google (Gemini), or any supported provider
- 5 minutes of your time
Fastest path: If you don't have OpenClaw running yet, Ampere.sh gives you a fully managed instance in 60 seconds. Just sign up, create an agent, and follow the Discord steps below.
Step 1: Create a Discord Application
Open the Discord Developer Portal at discord.com/developers/applications and sign in with your Discord account.
Click the "New Application" button in the top-right corner. Give your application a name — this will be your bot's display name in servers (you can change it later).
Examples: "Team AI", "ServerBot", "Assistant", or anything you like.
Click "Create" and you'll land on the application's General Information page.
Step 2: Create the Bot User & Enable Intents
In the left sidebar, click "Bot".
If there's no bot yet, click "Add Bot" and confirm. Discord will create a bot user for your application.
Now scroll down to Privileged Gateway Intents and enable these three toggles:
- Presence Intent — lets the bot see who's online (optional but useful)
- Server Members Intent — lets the bot see server members
- Message Content Intent — required so the bot can read messages
Click "Save Changes" at the bottom.
Important: Without Message Content Intent enabled, your bot will receive messages but they'll be empty. This is the #1 reason new bots seem broken — always make sure this toggle is ON.
Step 3: Copy Your Bot Token
Still on the Bot page, find the Token section near the top.
Click "Reset Token" (or "Copy" if you see it). Discord will show your bot token once — copy it immediately and save it somewhere safe.
You'll paste this token into OpenClaw in Step 5.
Security: Your bot token is like a password. Never share it publicly, commit it to Git, or post it in chat. Anyone with your token can control your bot. If it leaks, click "Reset Token" immediately to invalidate the old one.
Step 4: Invite the Bot to Your Discord Server
In the left sidebar, click "OAuth2".
Under OAuth2 URL Generator:
- In Scopes, check
bot - In Bot Permissions, select these permissions:
- Send Messages
- Send Messages in Threads
- Read Message History
- Add Reactions
- Embed Links
- Attach Files
- Use External Emojis
- Manage Messages (optional — for pin/delete capabilities)
Copy the Generated URL at the bottom, open it in your browser, select your server, and click "Authorize".
Your bot should now appear in your server's member list (it'll show as offline until OpenClaw connects).
Step 5: Add the Token to OpenClaw
Now connect OpenClaw to your Discord bot. There are two paths depending on your setup:
Option A: Using Ampere.sh (Managed)
- Log in to your Ampere Dashboard
- Go to Connections and select Discord
- Follow the setup steps — when prompted, send a message in the dashboard chat
- Your bot will ask for the token — paste the bot token you copied in Step 3
- Once connected, your bot comes online automatically
Option B: Self-Hosted OpenClaw
Edit your openclaw.yaml configuration file:
# openclaw.yaml
channels:
discord:
token: "YOUR_DISCORD_BOT_TOKEN"Replace YOUR_DISCORD_BOT_TOKEN with the token you copied in Step 3.
Step 6: Start (or Restart) the Gateway
If your OpenClaw gateway is already running, restart it to pick up the new Discord config:
$ openclaw gateway restart
✓ Gateway restarted
✓ Discord channel connected
✓ Logged in as YourBot#1234If you're starting fresh:
$ openclaw gateway start
✓ Gateway started (PID 54321)
✓ Discord channel connected
✓ Logged in as YourBot#1234Step 7: Test the Connection
Go to your Discord server and mention your bot in any channel:
You: @YourBot hey, are you alive?
YourBot: Hey! I'm online and ready to help. What can I do for you?If your bot responds — congratulations, you're done! Your OpenClaw bot is now live on Discord.
Configuring Your Discord Bot
Now that your bot is connected, here are the most useful configuration options:
Set Which Channels the Bot Listens To
By default, your bot can respond in any channel it has access to. You can restrict it to specific channels:
channels:
discord:
token: "YOUR_TOKEN"
allowedChannels:
- "general"
- "ai-chat"
- "bot-commands"Mention-Only vs. All Messages
Control whether the bot responds to every message or only when @mentioned:
channels:
discord:
token: "YOUR_TOKEN"
mentionOnly: true # only respond when @mentionedCustomize the Bot's Personality
Edit your agent's SOUL.md file to define how it behaves in Discord:
# SOUL.md
You are Atlas, the AI assistant for the DevTeam Discord server. You're
technical, helpful, and slightly witty. You help with coding questions, project
management, and server ops. Keep responses concise unless someone asks for detail.What Your Discord Bot Can Do
Once connected, your OpenClaw-powered Discord bot has capabilities far beyond a basic chatbot:
Persistent Memory
Remembers past conversations, user preferences, and community context across sessions.
Tool Access
Browse the web, run code, manage files, search databases — all from Discord chat.
Scheduled Tasks
Post daily briefings, weekly summaries, or timed reminders with cron jobs.
Emoji Reactions
React to messages with emojis naturally — acknowledge, appreciate, or respond without cluttering chat.
Installable Skills
Add image generation, weather, Hacker News, coding assistance, and more via ClawHub skills.
Smart Silence
Knows when to speak and when to stay quiet. Participates like a human — doesn't spam every message.
Advanced Discord Setup
Multiple Servers
One OpenClaw bot can be in multiple Discord servers simultaneously. Just invite it to each server using the OAuth2 URL from Step 4. The bot maintains context per-server automatically.
Thread Support
Your bot can read and reply in Discord threads. It even creates threads for long conversations to keep channels clean. No extra configuration needed — thread support is built in.
Polls, Stickers & Rich Messages
OpenClaw's Discord integration supports the full range of Discord features:
- Polls — create polls with custom options and duration
- Embeds — send rich embed messages with colors, fields, and images
- File uploads — share generated files, images, or documents
- Reactions — react to messages with any emoji
- Channel management — create/edit channels and categories (with proper permissions)
Connecting to Multiple Channels (Discord + Others)
OpenClaw isn't limited to Discord. You can connect multiple messaging platforms simultaneously:
channels:
discord:
token: "DISCORD_BOT_TOKEN"
telegram:
token: "TELEGRAM_BOT_TOKEN"
slack:
appToken: "SLACK_APP_TOKEN"
botToken: "SLACK_BOT_TOKEN"Your agent shares the same memory and personality across all platforms. A conversation started on Discord can be continued on Telegram — the context carries over.
Troubleshooting
Running into issues? Here are the most common problems when connecting OpenClaw to Discord:
Bot is online but doesn't respond
- Check Message Content Intent — this is the #1 issue. Go to Developer Portal → Bot → enable Message Content Intent
- Check channel permissions — make sure the bot has Send Messages and Read Message History in the channel
- Check if mention-only is set — if
mentionOnly: true, the bot only responds when @mentioned
Bot doesn't appear online
- Verify the token — make sure you copied the full token with no extra spaces
- Check gateway status — run
openclaw gateway statusand look for Discord connection errors - Token expired? — if you regenerated the token after adding it to OpenClaw, update the config with the new one
"Missing Permissions" errors
- Re-invite the bot using the OAuth2 URL with the correct permissions checked
- Check the channel's permission overrides — they can override server-level bot permissions
- Make sure the bot's role is high enough in the role hierarchy for the actions it needs to perform
Bot responds slowly
- This is usually the LLM response time, not Discord. Faster models (Claude Haiku, GPT-4o-mini) respond quicker
- Check your server resources if self-hosting — CPU/RAM might be constrained
- On Ampere, response times are optimized automatically
Frequently Asked Questions
Is the OpenClaw Discord bot free?
Can I use the bot in DMs?
Does the bot work with Discord slash commands?
Can I have multiple OpenClaw bots in one server?
How do I update the bot?
What AI models can the Discord bot use?
Can the bot moderate my Discord server?
Ready to go live?
Get a managed OpenClaw instance with Discord pre-configured on Ampere.
Get Started with Ampere