Discord Integration: Setup, Access Control, and Operations

Covers linking OpenClaw to Discord as a bot, including setup, access control, message behavior, threads, components, and events. Useful for admins configuring and troubleshooting a Discord integration.

Read this when

  • Working on Discord channel features

OpenClaw links up with Discord through the official Discord gateway, acting as a bot. Both DMs and guild channels work.

What each page covers

Where each section moved

Anchors for all section headings from the earlier single-page version are preserved on this page, so links already in use, like /channels/discord#voice-channels, still resolve. Each entry leads to the page where that content now lives.

Configuration reference

For the main reference, see Configuration reference - Discord.

High-signal Discord fields

  • startup/auth: enabled, token, applicationId, accounts.*, allowBots
  • policy: groupPolicy, dmPolicy, allowFrom, dm.*, guilds.*, guilds.*.channels.*
  • group introductions: joinIntro, accounts.*.joinIntro (default: true)
  • command: commands.native, commands.allowFrom (global), configWrites, slashCommand.ephemeral
  • gateway: proxy
  • reply/history: replyToMode, historyLimit, dmHistoryLimit, dms.*.historyLimit
  • delivery: textChunkLimit (default 2000), maxLinesPerMessage (default 17)
  • streaming: streaming.mode, streaming.chunkMode, streaming.preview.*, streaming.progress.*, streaming.block.* (the older flat keys streamMode, draftChunk, blockStreaming, blockStreamingCoalesce, chunkMode get migrated into streaming.* by openclaw doctor --fix)
  • media: mediaMaxMb (limits outbound Discord uploads, default 100)
  • actions: actions.*
  • presence: activity, status, activityType, activityUrl, autoPresence.*
  • features: threadBindings, top-level bindings[] (type: "acp"), pluralkit, execApprovals, intents, agentComponents.enabled, agentComponents.ttlMs, activities, responsePrefix

Discord Activities

Enable channels.discord.activities so the core show_widget tool can publish self-contained HTML widgets that open inside Discord. This block is opt-in. Discord registers the Activity plumbing statically, yet the current-channel presenter remains unavailable, and /discord/activity stays externally hidden behind the usual 404 until an enabled account has an available bot token, a resolved client secret, and an application ID. For Developer Portal, tunnel, security, and troubleshooting setup, see Discord Activities.

  • activities.clientSecret: OAuth2 client secret for the Discord application; falls back to DISCORD_CLIENT_SECRET
  • activities.applicationId: optional Activity application ID; defaults to the bot application ID learned at gateway startup

Safety and operations

  • Bot tokens should be treated as secrets (DISCORD_BOT_TOKEN is preferred in supervised environments).
  • DISCORD_API_URL overrides the process-wide, versioned Discord REST base (for example, https://discord.example.com/api/v10). That origin also serves OpenClaw for Gateway discovery, WebSocket connections, media, webhooks, OAuth, and command registration; while the override is set, requests do not fall back to public Discord. Plain HTTP/WS is accepted only on loopback, and Discord voice transport is unavailable with the override. Set it in the Gateway process environment or global runtime dotenv, not a workspace .env.
  • Grant Discord permissions at the least-privilege level.
  • When command deploy/state is stale, restart the gateway and re-check with openclaw channels status --probe.

Discord model-picker preferences and thread bindings use SQLite. Their old discord/model-picker-preferences.json and discord/thread-bindings.json files predate the July 2026 upgrade support window. Doctor preserves these files and reports recovery guidance instead of importing them. Keep a pre-update backup, upgrade through OpenClaw 2026.9.5, and run openclaw doctor --fix before installing the latest version. July SQLite state and the July command-deployment cache remain supported.

1,059 words · updated Oct 25, 2026