Discord bot quickstart

Developer Portal → token → Gateway → first message

This is the fast path for Discord. Voice channels, threads, stream previews, and server-wide policies are in the full Discord channel guide. Confirm exact config keys in official docs.

Time: about 15–20 minutes if OpenClaw is already installed.

Before you start

  • OpenClaw installed (installation) and an LLM provider configured.
  • A Discord account with permission to create applications (or use a test server you admin).
  • Message Content Intent is required—Discord will not deliver message text without it.

Step 1 — Create the bot in Discord Developer Portal

  1. Open Discord Developer PortalNew Application.
  2. Name the app → BotAdd Bot → copy the token (treat like a password).
  3. Under Privileged Gateway Intents, enable Message Content Intent.

Optional: set username/avatar under Bot settings.

Step 2 — Invite the bot to your server

  1. OAuth2URL Generator → scope bot.
  2. Permissions (minimum for testing): Send Messages, Read Message History, View Channels, Embed Links, Attach Files.
  3. Open the generated URL, pick your server, authorize.

The bot should appear offline until the Gateway connects.

Step 3 — Add the token to OpenClaw

During openclaw onboard, enable Discord and paste the token—or add under channels.discord in configuration (see Discord reference for JSON shape).

You can also set DISCORD_BOT_TOKEN in the environment on the Gateway host.

Step 4 — Start the Gateway

Terminal
openclaw gateway start
openclaw doctor

Doctor should report Discord healthy. For 24/7, use a VPS or home server that does not sleep.

Step 5 — Pair and send a test message

  1. DM test: Open a direct message to your bot. With default pairing, unknown users get a code first.
  2. Approve on the host: openclaw pairing list discord then openclaw pairing approve discord <code> (pairing guide).
  3. Server test: In a text channel, mention the bot or use your configured activation pattern (see full guide).

Run openclaw security audit --deep before opening DMs to everyone (safety checklist).

Troubleshooting

Symptom Likely cause Fix
Bot online but ignores messagesMessage Content Intent offEnable intent; restart Gateway
401 / invalid tokenWrong or reset tokenRegenerate token in portal; update config
Missing access in channelRole/channel permissionsRe-invite with permissions; check channel overrides
Only pairing repliesNot approvedpairing approve

More errors: Discord guide and troubleshooting.

What to do next