Connect OpenClaw to Discord: Bot Setup Guide

SetupDiscord

Connect OpenClaw to Discord: Bot Setup Guide

Connect OpenClaw to Discord. Create a bot, set up intents, and start chatting in your server.

7 min readLast updated Feb 18, 2026
Stuck?Check the troubleshooting index or ask in Discord.

Overview

Discord is a popular choice for running OpenClaw in servers or communities. This guide walks you through creating a Discord bot, configuring it, and connecting it to OpenClaw.

What you'll need
  • A Discord account
  • Permission to manage bots in a Discord server (Server Admin)
  • OpenClaw installed (see Getting Started)

Create Discord App & Bot

First, we need to create an application and bot in the Discord Developer Portal.

1

Go to Discord Developer Portal

2

Create new application

Click New Application (top right). Give it a name (e.g., "OpenClaw Assistant").

3

Add a bot

Click Bot in the left sidebar, then Add Bot.

4

Copy the token

Click Reset Token to reveal your bot token, then copy it.

Keep your token safe
This token is like a password. Don't share it publicly. If you lose it, you can reset it here.

Enable Privileged Intents

Discord requires you to enable certain "intents" for the bot to access specific data.

1

Go to Bot settings

In the Developer Portal, go to Bot → scroll down to Privileged Gateway Intents.

2

Enable Message Content Intent

Toggle Message Content Intent to ON. This is required for the bot to read messages.

3

Enable Server Members Intent

Toggle Server Members Intent to ON. This helps with user allowlists and role-based routing.

Invite Bot to Server

Now let's generate an invite link to add the bot to your server.

1

Go to OAuth2

In the Developer Portal, go to OAuth2URL Generator.

2

Select scopes

Check the following scopes:

  • bot
  • applications.commands
3

Select permissions

Under Bot Permissions, select:

  • View Channels
  • Send Messages
  • Read Message History
  • Embed Links
  • Attach Files
  • Add Reactions (optional)
4

Copy and visit URL

Copy the generated URL at the bottom and open it in your browser. Select your server and authorize.

Configure OpenClaw

Now let's tell OpenClaw about your Discord bot.

Open your config.yaml and add:

config.yaml
channels:
  discord:
    enabled: true
    token: "YOUR_BOT_TOKEN"

Start the Gateway

Start OpenClaw and let it connect to Discord:

terminal
openclaw gateway

You should see logs indicating Discord is connecting. Once connected, it's time to authorize yourself.

Pair Your Account

By default, Discord DMs require pairing (authorization). Here's how to approve yourself:

1

Find your pairing code

Run this command in your terminal:

bash
openclaw pairing list discord

You'll see a code like ABC123.

2

DM the bot

Go to your bot in Discord and send it a direct message with the code:

text
ABC123
3

Approve the pairing

Back in your terminal:

bash
openclaw pairing approve discord ABC123
Pairing expires after 1 hour
If you don't complete pairing within an hour, you'll need to repeat the process.

Test It

Now let's verify everything works:

1

Mention the bot

In your Discord server, mention your bot (e.g., @YourBot) or send it a direct message.

2

Wait for a response

Your AI assistant should respond. If it doesn't, check the troubleshooting section below.

You're set up!
Your Discord bot is now connected to OpenClaw. You can now chat with your AI assistant in your server or via DM.

Troubleshooting

Common issues and how to fix them:

Bot doesn't respond to messages

  • Make sure you've enabled Message Content Intent in Developer Portal
  • Check that Discord is enabled: openclaw channels status
  • Check logs: openclaw logs --follow

Bot can't see messages in channels

  • Verify the bot has been invited with the correct permissions
  • Make sure the bot is online (green status in Discord)
  • Check that your server allows the bot in that channel

Finding your Discord user ID

Some configs require your numeric user ID. Enable Developer Mode in Discord (Settings → Advanced → Developer Mode), then right-click your name and "Copy User ID".