Connect your agent to Discord

About 10 minutes. By the end, you'll have a Discord bot in your server that talks to your agent. The setup has more steps than Telegram because Discord splits bot creation into a developer portal and an invite flow — but it's still a one-time thing.

Before you start

  • An agent already deployed and showing active in the portal
  • A Discord account
  • A Discord server where you have Manage Server or Administrator permission (you can't add a bot to a server you don't admin)
  • About 10 minutes
The mental model

Unlike Telegram, Discord doesn't have a chat-with-a-bot-to-make-a-bot flow. You go to Discord's developer portal in your browser, register an application, attach a bot to that application, generate an invite URL, click the URL to add the bot to your server, and finally paste the bot's token into OpenClaw. Sounds like a lot — it's about 10 clicks total.

Step 1 — Create a Discord application

  1. Go to discord.com/developers/applications. Log in if you aren't already.
  2. Click New Application in the top right.
  3. Give it a name. This shows in the developer portal and inside Discord — using your agent's name is fine. Example: Acme Support.
  4. Accept the developer terms, click Create.

Step 2 — Configure the bot

  1. You should now be on the application's settings page. In the left sidebar, click Bot.
  2. Under Privileged Gateway Intents, enable:
    • Server Members Intent — required if your agent personalizes by user
    • Message Content Intent — required for the bot to read message content (most agents need this)
    Discord defaults these to off for privacy reasons; without them, the bot can only see its mentions, not full message content.
  3. Click Save Changes.

Step 3 — Copy the bot token

  1. Still on the Bot page, click Reset Token (orView Token if available). Discord generates the token and shows it once.
  2. Copy the token. It looks like:
    MTAxNjMwODc4ODI3MTQ1NDgwMA.GxYz_a.AbCdEfGhIjKlMnOpQrStUvWxYz1234567890ABCD
Treat the token like a password

Anyone with the bot token can read and post messages as your bot in any server it's in. Don't paste it into public channels, screenshots, gists, or git commits. If it leaks, click Reset Token in the Bot page to invalidate it; you'll need to update OpenClaw with the new one.

Step 4 — Generate an invite URL

  1. In the left sidebar, click OAuth2, then URL Generator.
  2. Under Scopes, check:
    • bot
    • applications.commands (lets you register slash commands later)
  3. A second box (Bot Permissions) appears. Check at minimum:
    • Read Messages/View Channels
    • Send Messages
    • Embed Links
    • Read Message History
    • Use Slash Commands
    Skip Administrator. Bots almost never need it, and granting it makes you a bigger blast radius if the token ever leaks.
  4. Discord generates an invite URL at the bottom of the page. Copy it.

Step 5 — Invite the bot to your server

  1. Paste the invite URL into your browser's address bar and hit Enter.
  2. Discord asks which server to add the bot to. Pick your target server (you must have Manage Server or Administrator in it).
  3. Confirm the requested permissions match what you set in Step 4. Click Authorize.
  4. Discord shows a captcha, then a success screen. The bot is now in your server, listed in the member sidebar but offline (it has no software running yet — that's the next step).

Step 6 — Paste the token into OpenClaw

  1. From the Cloudo portal, click Open my OpenClaw on the agent you want to connect.
  2. Open the Channels tab.
  3. Click Discord, then Connect.
  4. Paste the bot token from Step 3 into the Bot Token field.
  5. Click Save. OpenClaw connects to Discord's gateway and confirms with something like:
    Connected as Acme Support#1234 (in 1 server: My Server)

Within a few seconds the bot's status changes from offline to online in the Discord member sidebar.

Step 7 — Send the first message

In your Discord server, in any channel the bot has access to, mention the bot:

@Acme Support hi, what can you do?

Your agent should reply within a few seconds, in its configured voice. If you didn't @-mention the bot, it won't respond — Discord defaults bots to mention-only behavior unless you change it (see below).

Optional polish

Slash commands

OpenClaw can register slash commands like /help, /reset, /contact-human. Define them in OpenClaw's Discord channel config; Discord registers them globally within ~30 minutes (or instantly within a single server).

Channel scoping

By default, the bot listens in every channel it can see. To scope it to specific channels, adjust per-channel role permissions in Discord, or configure OpenClaw to only respond in a configured allowlist.

Bot avatar + description

Back in the developer portal at the application's root settings: upload an avatar (square image), set a short description (shown to users who view the bot's profile).

Troubleshooting

Bot is online but doesn't respond when mentioned

Most likely cause: the Message Content Intent is off.

  1. Go back to the developer portal → your application → Bot tab.
  2. Scroll to Privileged Gateway Intents.
  3. Enable Message Content Intent (and Server Members Intent if your agent personalizes by user).
  4. Save.
  5. Restart the connection in OpenClaw (disconnect, reconnect with the same token).

If intents are on and the bot still doesn't respond, check the bot's permission in the specific channel — sometimes a channel-level role override removes View Channel or Send Messages.

“401 Unauthorized” or “invalid token”

The token is wrong or has been reset. Go to the developer portal → Bot → Reset Token, copy the new one, paste into OpenClaw, save.

Bot stays offline after I save the token

Check, in order:

  1. OpenClaw shows the connection as connected (not error) — if it shows error, the token is wrong.
  2. Your credit balance is above zero — the connection stays live but your agent won't respond if your credit has run out.
  3. The bot was actually invited to the server (Step 5). The Bot tab and the OAuth2 invite are separate steps; it's easy to skip the invite and wonder why the bot isn't in the server.

I want to remove the bot from a server

Right-click the bot in the Discord member sidebar → Kick. The bot leaves but the application + token stay valid; you can re-invite it (Step 5) without re-registering.

I want to delete the bot entirely

Developer portal → your application → General Information Delete App at the bottom. This invalidates the token permanently.


Done. Your agent is now answering on Discord, in your configured voice, with the same SOUL and skills as on every other channel. One agent, every channel.

Next up: connect Slack, or revisit Telegram if you haven't set that up yet. Or head back to the docs index.

Conectar Discord — Documentación de Cloudo