Discord is where communities live. If you run a server for your team, your community, or just yourself, connecting OpenClaw turns it into an always-on AI workspace. Every channel gets its own agent session. Every DM gets instant responses. Here is the complete setup, from bot creation to guild configuration.

Why Run OpenClaw on Discord

Most AI Discord bots are glorified chatbots. You type a prompt, you get a response, end of story. OpenClaw is different because it runs as a full agent with memory, tools, file access, cron jobs, and skills.

On Discord specifically, you get features that other channels don't offer:

I run 13 agents on a single Mac Mini. Discord is one of the channels I use daily for project coordination. Here is exactly how to set it up.

Step 1: Create Your Discord Bot Application

Go to the Discord Developer Portal and click New Application.

Name it whatever you want. I called mine "Marc" because that is my agent's name. You can change it later.

Click Bot on the left sidebar. Set the Username to your agent's name. This is what shows up in your server.

Tip: If you don't have a Discord server yet, create one first. Go to Discord, click the + icon on the left sidebar, choose "Create My Own" then "For me and my friends." You need a server before you can add the bot.

Step 2: Enable Privileged Gateway Intents

Still on the Bot page in the Developer Portal, scroll down to Privileged Gateway Intents. You need to enable these:

IntentRequired?Why
Message Content IntentYesWithout this, the bot cannot read messages. Nothing works.
Server Members IntentRecommendedRequired for role-based allowlists and matching usernames to IDs.
Presence IntentOptionalOnly needed if you want presence updates. Most setups skip this.

Toggle them on and save. The Message Content Intent is non-negotiable. Without it, your bot receives empty messages.

Step 3: Generate the Invite URL and Add the Bot

Click OAuth2 on the left sidebar. Scroll down to OAuth2 URL Generator.

Check these scopes:

A Bot Permissions section appears below. Enable:

Copy the generated URL at the bottom. Paste it into your browser. Select your server. Click Continue.

Your bot should now appear in the server member list. It will be offline until you connect OpenClaw.

Step 4: Connect OpenClaw to Your Discord Bot

Before connecting, you need your bot token. Go back to the Bot page in the Developer Portal and click Reset Token. Despite the scary name, this just generates your first token. Copy it immediately. You will not see it again.

Never share your bot token. Anyone with this token can control your bot. Treat it like a password. Don't paste it in Discord messages or public channels.

On the machine running OpenClaw, set the token via CLI:

openclaw config set channels.discord.token '"YOUR_BOT_TOKEN"' --json
openclaw config set channels.discord.enabled true --json
openclaw gateway restart

If OpenClaw is not running yet, use openclaw gateway start instead of restart.

You can also set it in your openclaw.json config file directly:

{
  "channels": {
    "discord": {
      "enabled": true,
      "token": "YOUR_BOT_TOKEN"
    }
  }
}

Need help installing OpenClaw first? Start at installopenclawnow.com for the fastest path.

Step 5: Pair Your Discord Account

Once the gateway is running with Discord enabled, open Discord and DM your bot directly.

The bot will reply with a pairing code. This code links your Discord account to your OpenClaw identity.

To approve the pairing, you have two options:

Option A: Tell your agent on another channel (like Telegram): "Approve this Discord pairing code: ABC123"

Option B: Use the CLI:

openclaw pairing list discord
openclaw pairing approve discord ABC123

Pairing codes expire after 1 hour. Once approved, you can chat with your agent in Discord DMs.

DMs not working? Right-click your server icon, go to Privacy Settings, and toggle on "Direct Messages." This lets server members (including bots) DM you. You can disable it after pairing if you only want to use guild channels.

Step 6: Set Up Your Guild as a Full Workspace

DMs are great, but the real power is running OpenClaw across your entire server. Each channel becomes its own agent session with isolated context.

First, you need your Server ID and User ID. Enable Developer Mode in Discord: User Settings (gear icon) then Advanced then toggle Developer Mode. Then right-click your server icon and select "Copy Server ID." Right-click your own avatar for your User ID.

Add your server to the guild allowlist. Tell your agent:

"Add my Discord Server ID 123456789 to the guild allowlist"

Or set it in config:

{
  "channels": {
    "discord": {
      "groupPolicy": "allowlist",
      "guilds": {
        "YOUR_SERVER_ID": {
          "requireMention": true,
          "users": ["YOUR_USER_ID"]
        }
      }
    }
  }
}

With requireMention: true, the bot only responds when you @mention it. Set it to false if you want it to respond to every message in every channel. I recommend keeping mentions on for busy servers and turning them off for private workspaces.

Access Control and Allowlists

OpenClaw gives you fine-grained control over who can talk to your bot:

For a personal server where it is just you and the bot, the config above is all you need. For community servers, lock it down with role-based access so only moderators or specific members can trigger the agent.

Pro tip: Create a dedicated "AI" role in your Discord server. Add it to the allowlist. Assign it to yourself and anyone you trust. This makes adding or removing access easy without touching config files.

Discord vs Telegram vs WhatsApp for OpenClaw

All three channels work with OpenClaw. Here is when Discord makes the most sense:

FeatureDiscordTelegramWhatsApp
Per-channel sessionsYesVia forum topicsNo
Thread supportNativeForum topicsNo
Slash commandsYesBot commandsNo
File sharingExcellentGoodLimited
Voice channelsYes (/vc join)NoNo
Mobile experienceGoodGreatGreat
Setup complexityMediumEasyEasy

Use Discord if you want organized channel-based workflows or if your team already lives there. Use Telegram if you want the fastest mobile experience. Use WhatsApp if you want to chat with your agent the same way you text friends.

Nothing stops you from running all three simultaneously. Same agent, multiple channels, shared memory.

Common Issues and Fixes

Bot is online but not responding: Check that Message Content Intent is enabled in the Developer Portal. This is the #1 issue. Without it, the bot receives messages with empty content.

Pairing code not appearing: Make sure DMs are enabled on your server. Right-click the server icon, then Privacy Settings, then Direct Messages, then toggle On.

Bot responds in DMs but not in channels: You need to add the server to the guild allowlist. See Step 6 above. The bot defaults to DM-only mode.

"Missing Access" errors: The bot needs View Channels and Send Messages permissions in the specific channel. Check the channel's permission overrides in Discord server settings.

Gateway not starting after adding Discord: Verify your bot token is correct. A single extra space or missing character will cause authentication failure. Re-copy the token from the Developer Portal.

For more detailed troubleshooting, check the complete OpenClaw troubleshooting guide.

OpenClaw Lab is the #1 community for founders building AI agent systems. I share the exact playbooks, skill files, and workflows inside. Weekly lives, expert AMAs, and 265+ members building real systems.

Join OpenClaw Lab →