Integrate OpenClaw with Discord
Connect your agent to a Discord bot to chat with it remotely.
Learning objectives
In this guide, you will learn how to:
- Create a Discord bot and generate an API token.
- Invite the bot to your Discord server with the required permissions.
- Connect the bot to OpenClaw and configure channel access policies.
- Pair your Discord account with the bot so you can chat with your agent.
Prerequisites
- Discord account: Required to create the bot application.
- Discord server: A server where you have permissions to add bots.
Step 1: Create a Discord bot
Log in to the Discord Developer Portal with your Discord account.
Click New Application.

Enter a name for the new app, agree to terms, and then click Create.

From the left sidebar, select Bot.
Scroll down to the Privileged Gateway Intents section and enable the following settings:
- Presence Intent
- Server Members Intent
- Message Content Intent
Click Save Changes.
Scroll up to the Token section, click Reset Token, and then copy the generated token for your Discord bot. You need the token for channel configuration later in Control UI.

Step 2: Invite the bot to server
From the left sidebar, select OAuth2, and then find the OAuth2 URL Generator section:
a. In Scopes, select Bot and applications.commands.

b. Scroll down to Bot Permissions, set as the following image. You can modify the settings later.

Copy the Generated URL at the bottom.
Paste the URL into a new browser tab, select your Discord server from Add to server, click Continue, and then click Authorize.
The bot is authorized and added to your server.

Step 3: Configure the channel
Open the Control UI, click the user account in the lower left, and then select Settings.
Select Channels from the left sidebar, locate Discord, and then click Set up.
In the Set up Discord window, review How channels work, scroll down, and then click Continue.
Configure the settings as follows:
Settings Option Default (primary) How do you want to provide this Discord bot token Enter Discord bot token Paste the bot token from Step 1 Yes Open (allow all channels) Configure DM access policies now?
(default: pairing)Yes Review and continue Pairing (recommended) Continue Finish
Step 4: Authorize your account
For security, the bot does not talk to unauthorized users. You must pair your Discord account with the bot.
Open Discord and send a Direct Message (DM) to your new bot. The bot will reply with an error message containing a Pairing Code.
Open the OpenClaw CLI and enter the following command:
bashopenclaw pairing approve discord {Your-Pairing-Code}Once approved, you can start chatting with your agent in Discord.