Guides

How to Set Up an OpenClaw Discord Bot with Slash Commands (2026)

Complete guide to connecting OpenClaw to Discord. Create a bot, configure permissions, set up slash commands, and troubleshoot common Discord integration issues.

How to Set Up an OpenClaw Discord Bot with Slash Commands (2026)

This guide walks through every step of connecting OpenClaw to Discord — from creating your bot application to configuring slash commands and troubleshooting the most common issues.

Want to skip all of this? NeatClaw connects to Discord with a single OAuth click — no Developer Portal, no token management, no configuration files.


Prerequisites

  • A Discord account
  • "Manage Server" permission on the target Discord server
  • OpenClaw installed and running (or use NeatClaw to skip installation)

Estimated time: 10–15 minutes


Step 1: Create a Discord Application

  1. Open the Discord Developer Portal
  2. Click New Application in the top right
  3. Name your application (e.g., "OpenClaw Assistant")
  4. Accept Discord's Terms of Service
  5. Click Create

What is a Discord Application? Think of it as a registered identity for your bot — similar to creating a developer account, but for automated software.


Step 2: Create the Bot User and Get Your Token

  1. In your application, click Bot in the left sidebar
  2. Click Add BotYes, do it!
  3. Under Token, click Reset TokenYes, do it!
  4. Click Copy to save your token

Security: Your bot token is equivalent to a password. Never share it publicly or commit it to a repository.

Token format: MTk4NjIyNDgzNDk0MjE3MjE2.Cl2FMQ.ZnCjm1XVW7vRze4b7Cq4se7kKWs


Step 3: Configure Bot Permissions

Still in the Bot section, scroll down to Privileged Gateway Intents and enable:

Intent Why It's Required
Presence Intent See user online status
Server Members Intent See who's in the server
Message Content Intent Critical — read what users type

Warning: Without Message Content Intent, your bot will appear online but will never respond to messages. This is the #1 Discord setup mistake.

Click Save Changes at the bottom.


Step 4: Add the Bot to Your Server

  1. Click OAuth2URL Generator in the left sidebar
  2. Under Scopes, select:
    • bot
    • applications.commands (required for slash commands)
  3. Under Bot Permissions, select:
    • ☑ Send Messages
    • ☑ Send Messages in Threads
    • ☑ Embed Links
    • ☑ Attach Files
    • ☑ Read Message History
    • ☑ Add Reactions
    • ☑ Use Slash Commands
  4. Copy the generated URL at the bottom
  5. Paste it in your browser, select your server, click Authorize

Your bot will appear in the server member list (offline until OpenClaw connects).


Step 5: Configure OpenClaw

Update your .env file

# ~/.openclaw/.env
DISCORD_BOT_TOKEN=your-bot-token-here

Update config.json

{
  "channels": {
    "discord": {
      "enabled": true,
      "features": ["text", "embeds", "reactions", "files"],
      "allowedGuilds": [],
      "allowedChannels": [],
      "slashCommands": true,
      "prefix": "!",
      "autoReply": true,
      "typingIndicator": true
    }
  }
}

Key settings explained:

  • allowedGuilds: [] — empty means all servers; add server IDs to restrict
  • allowedChannels: [] — empty means all channels; add channel IDs to restrict
  • slashCommands: true — enables / commands
  • typingIndicator: true — shows "Bot is typing..." while processing

Restart OpenClaw

openclaw stop
openclaw start
openclaw logs  # Should show: Discord bot connected successfully

Step 6: Set Up Slash Commands

{
  "channels": {
    "discord": {
      "slashCommands": true,
      "commands": [
        {
          "name": "ask",
          "description": "Ask the AI assistant a question",
          "options": [
            {
              "name": "question",
              "description": "Your question",
              "type": "string",
              "required": true
            }
          ]
        },
        {
          "name": "reset",
          "description": "Clear conversation memory"
        },
        {
          "name": "help",
          "description": "Show available commands"
        }
      ]
    }
  }
}

After saving, run openclaw restart. Slash commands take 1–5 minutes to appear in Discord.


Testing Your Bot

  1. Message test: Type a message in any channel where the bot has access. If autoReply: true, it should respond.
  2. Slash command test: Type /ask and submit a question. The bot should reply.
  3. Permission test: Send an image, a file, and a reaction — verify each works.

Troubleshooting

Bot is online but doesn't respond to messages

This is almost always a Message Content Intent issue.

  1. Go to Discord Developer Portal
  2. Your Application → Bot → Privileged Gateway Intents
  3. Enable Message Content Intent
  4. Save, restart OpenClaw

Slash commands don't appear

  1. Wait 1–5 minutes — Discord propagates commands on their own schedule
  2. Ensure applications.commands scope was selected when inviting the bot
  3. Fully quit and reopen the Discord app (not just refresh)
  4. Check openclaw logs for command registration errors

Bot shows "Missing Access" errors

The bot needs Send Messages permission in that specific channel:

  1. Right-click the channel → Edit Channel → Permissions
  2. Add the bot role with Send Messages enabled

Advanced Discord Features

Thread Support

{
  "discord": {
    "features": ["threads"],
    "autoCreateThreads": true,
    "threadPrefix": "AI Chat —"
  }
}

Custom Rich Embeds

{
  "discord": {
    "embedStyle": {
      "color": "#5865F2",
      "footer": "Powered by OpenClaw"
    }
  }
}

Reaction Controls

{
  "discord": {
    "reactionControls": {
      "enabled": true,
      "reactions": {
        "👍": "positive_feedback",
        "🔄": "regenerate_response"
      }
    }
  }
}

The 1-Click Alternative

Setting up Discord manually requires: creating a Developer Application, configuring 10+ permissions, managing OAuth2 URLs, editing config files, troubleshooting gateway intents, and registering slash commands.

NeatClaw reduces this to:

  1. Click Connect Discord
  2. Authorize with Discord (OAuth2)
  3. Select your server
  4. Done — bot is online with slash commands pre-configured

Get 1-click Discord setup with NeatClaw


Sources: Discord Developer Documentation, OpenClaw Discord Integration Docs

Skip the setup. Start using OpenClaw now.

Your managed agent live in 2 minutes. No terminal, no Docker, no debugging.

Get started free