Tutorial

OpenClaw + Discord Integration Guide

February 14, 20268 min readReviewed March 8, 2026

Discord is one of the most popular platforms for communities, and OpenClaw makes it incredibly easy to add AI capabilities to your server. This guide walks you through creating an AI-powered Discord bot.

Prerequisites

Before starting, ensure you have:

  • OpenClaw installed and configured
  • A Discord account
  • Permissions to create bots in your server
  • Your chosen LLM API key (Anthropic Claude or OpenAI)

Step 1: Create a Discord Application

  1. Go to the Discord Developer Portal
  2. Click "New Application"
  3. Give your bot a name (e.g., "OpenClaw Assistant")
  4. Click "Create"

Step 2: Create the Bot User

In your application settings:

  1. Navigate to the "Bot" section
  2. Click "Add Bot"
  3. Confirm by clicking "Yes, do it!"
  4. Copy your bot token (you'll need this for OpenClaw)
Keep your token secret! Anyone with your bot token can control your bot. Never commit it to version control.

Step 3: Configure Bot Permissions

In the Bot section, enable these privileged intents:

  • MESSAGE CONTENT INTENT - Required to read messages
  • SERVER MEMBERS INTENT - For user information (optional)

Also enable:

  • Presence Intent (if you want status updates)
  • Public bot (if you want others to invite it)

Step 4: Configure OpenClaw

Edit your OpenClaw configuration:

# ~/.config/openclaw/config.yaml integrations: discord: enabled: true botToken: "YOUR_BOT_TOKEN_HERE" clientId: "YOUR_CLIENT_ID"

Step 5: Generate Invite Link

Use OpenClaw to generate an invite URL for your bot:

# Generate invite URL with default permissions openclaw discord invite --permissions "2147483647"

Or manually construct the URL:

https://discord.com/api/oauth2/authorize?client_id=YOUR_CLIENT_ID&permissions=2147483647&scope=bot%20applications.commands

Step 6: Invite Bot to Server

  1. Open the invite URL in your browser
  2. Select your server from the dropdown
  3. Click "Authorize"
  4. Complete the CAPTCHA if prompted

Step 7: Start OpenClaw

# Start the daemon openclaw daemon start # Verify Discord connection openclaw integrations status discord

Step 8: Test Your Bot

In your Discord server:

  • Type /openclaw to see available commands
  • Or mention your bot: @OpenClawBot hello
  • The bot should respond with AI-generated text

Slash Commands

OpenClaw automatically registers these slash commands:

  • /ask - Ask the AI a question
  • /chat - Start or continue a conversation
  • /reset - Reset conversation context
  • /help - Show available commands

Advanced Configuration

Custom Prefix

Change the command prefix for message-based commands:

# config.yaml integrations: discord: commandPrefix: "!" # Use ! instead of default

Channel Filtering

Limit bot responses to specific channels:

# config.yaml integrations: discord: allowedChannels: - "ai-chat" - "bot-commands" blockedChannels: - "general" - "announcements"

Multi-Agent per Server

Route different servers to different agents:

# config.yaml routing: discord: - match: server: "My Server ID" channel: "coding" agent: "coding-assistant" - match: server: "My Server ID" channel: "writing" agent: "writer-assistant"

Rich Embeds

OpenClaw can send rich Discord embeds for better formatting:

# config.yaml integrations: discord: embeds: enabled: true color: "#ff4757" includeTimestamp: true

Troubleshooting

Bot Not Responding

  • Check daemon is running: openclaw daemon status
  • Verify bot token is correct
  • Ensure MESSAGE CONTENT INTENT is enabled
  • Check logs: openclaw daemon logs

"Invalid Intent" Error

  • Go to Discord Developer Portal
  • Enable Privileged Gateway Intents
  • Toggle MESSAGE CONTENT INTENT on
  • Save changes and restart OpenClaw

Bot Can't Read Messages

  • Verify bot has "Read Messages" permission in channel
  • Check "View Channel" permission is enabled
  • Ensure bot wasn't kicked from server

Use Cases

OpenClaw on Discord is perfect for:

  • Moderation Assistance: Help review and flag content
  • Community Support: Answer common questions automatically
  • Knowledge Base: AI that knows your server's documentation
  • Coding Help: Code review and assistance in dev servers
  • Games & Fun: AI-powered games and trivia

What's Next?


References

  1. OpenClaw Official Documentation - https://docs.openclaw.ai/ - Accessed February 2026
  2. OpenClaw GitHub Repository - https://github.com/openclaw/openclaw - Accessed February 2026
  3. Discord Developer Portal - https://discord.com/developers/docs - Accessed February 2026
  4. Discord Bot Permissions Calculator - Permissions Reference - Accessed February 2026

Ready to build?

Create an intelligent Discord bot with OpenClaw today.

Get Started

Reference Trail

External sources surfaced from the underlying article content

  1. Discord Developer Portaldiscord.com
  2. https://docs.openclaw.ai/docs.openclaw.ai
  3. https://github.com/openclaw/openclawgithub.com
  4. https://discord.com/developers/docsdiscord.com
  5. Permissions Referencediscord.com
Back to ArchiveMore: TutorialsNext: OpenClaw + Telegram Integration Guide