Skip to main content
🎤 Luca Berton is speaking at Red Hat Summit & KubeCon EU 2026!Learn more →
Back to Blog

OpenClaw Discord Bot Setup

Set up an OpenClaw AI agent as a Discord bot. Learn how to create the bot, configure permissions, and get your agent responding in channels.

Luca BertonFebruary 21, 20262 min read

Why Discord + OpenClaw?

Discord is where developer communities live. With OpenClaw, your AI agent becomes a full Discord participant — responding to mentions, managing channels, reacting to messages, and running automations.

Step 1: Create a Discord Bot

  1. Go to the Discord Developer Portal
  2. Click New Application → name it
  3. Go to Bot → click Add Bot
  4. Copy the Bot Token (keep it secret!)
  5. Enable Message Content Intent under Privileged Intents

Step 2: Invite the Bot

Generate an invite URL with these permissions: - Send Messages - Read Message History - Add Reactions - Use Slash Commands - Manage Messages (optional)

https://discord.com/api/oauth2/authorize?client_id=YOUR_CLIENT_ID&permissions=274877975552&scope=bot
Related Course

Master this topic with hands-on labs

Go beyond reading — build real projects in sandboxed environments with expert video guidance.

Browse Courses →

Step 3: Configure OpenClaw

bash
openclaw config set discord.token YOUR_BOT_TOKEN
openclaw gateway restart

Step 4: Set Up Channels

Configure which channels your agent monitors:

yaml
discord:
  token: "YOUR_BOT_TOKEN"
  channels:
    - id: "123456789"
      mode: "mention"  # Only respond when mentioned
    - id: "987654321"
      mode: "all"      # Respond to everything

Bot Behavior in Groups

OpenClaw agents are smart about group chat participation:

  • Respond when directly mentioned or asked a question
  • React with emoji when acknowledging without a full reply
  • Stay silent during casual banter that doesn't need AI input
  • Never dominate the conversation

This is configured in AGENTS.md — your agent follows social norms.

Stay Updated

Get weekly IT automation tips

Docker, Ansible, Terraform, MLOps — curated insights delivered to your inbox. No spam.

Subscribe Free →

Advanced: Multiple Servers

One OpenClaw instance can serve multiple Discord servers. Each channel can have different modes and permissions.

Troubleshooting

Bot doesn't respond

  • Check the bot token is correct
  • Verify Message Content Intent is enabled
  • Ensure the bot has permission to read/send in the channel

Bot responds to everything

  • Switch channel mode to mention instead of all
  • Review your AGENTS.md group chat rules

Slow responses

  • Check your LLM API key and quota
  • Run openclaw status to verify the gateway is healthy

---

Ready to go deeper? Check out our hands-on course: OpenClaw Agent — practical exercises you can follow along on your own machine.

For a production-focused walkthrough, see Luca Berton's guide on the Ansible intelligent assistant and MCP server.

Ready to learn by doing?

Stop reading tutorials — start building. Expert video courses with hands-on labs in real sandboxed environments.

Share this article
LB
Luca Berton

Docker Captain, IT automation expert, Red Hat Summit & KubeCon speaker. Building hands-on education for DevOps engineers at CopyPasteLearn.

Related Articles

Explore topics

Browse more articles on the topics covered here.