Discord
Discord (Bot API)
Section titled “Discord (Bot API)”Status: ready for DMs and guild channels via the official Discord gateway.
Discord DMs default to pairing mode.
Native command behavior and command catalog.
Cross-channel diagnostics and repair flow.
Quick setup
Section titled “Quick setup”You will need to create a new application with a bot, add the bot to your server, and pair it to OpenClaw. We recommend adding your bot to your own private server. If you don’t have one yet, create one first (choose Create My Own > For me and my friends).
Create a Discord application and bot
Go to the Discord Developer Portal and click New Application. Name it something like “OpenClaw”.
Click Bot on the sidebar. Set the Username to whatever you call your OpenClaw agent.
Enable privileged intents
Still on the Bot page, scroll down to Privileged Gateway Intents and enable:
- Message Content Intent (required)
- Server Members Intent (recommended; required for role allowlists and name-to-ID matching)
- Presence Intent (optional; only needed for presence updates)
Copy your bot token
Scroll back up on the Bot page and click Reset Token.
Copy the token and save it somewhere. This is your Bot Token and you will need it shortly.
Generate an invite URL and add the bot to your server
Click OAuth2 on the sidebar. You’ll generate an invite URL with the right permissions to add the bot to your server.
Scroll down to OAuth2 URL Generator and enable:
botapplications.commands
A Bot Permissions section will appear below. Enable:
- View Channels
- Send Messages
- Read Message History
- Embed Links
- Attach Files
- Add Reactions (optional)
Copy the generated URL at the bottom, paste it into your browser, select your server, and click Continue to connect. You should now see your bot in the Discord server.
Enable Developer Mode and collect your IDs
Back in the Discord app, you need to enable Developer Mode so you can copy internal IDs.
- Click User Settings (gear icon next to your avatar) → Advanced → toggle on Developer Mode
- Right-click your server icon in the sidebar → Copy Server ID
- Right-click your own avatar → Copy User ID
Save your Server ID and User ID alongside your Bot Token — you’ll send all three to OpenClaw in the next step.
Allow DMs from server members
For pairing to work, Discord needs to allow your bot to DM you. Right-click your server icon → Privacy Settings → toggle on Direct Messages.
This lets server members (including bots) send you DMs. Keep this enabled if you want to use Discord DMs with OpenClaw. If you only plan to use guild channels, you can disable DMs after pairing.
Set your bot token securely (do not send it in chat)
Your Discord bot token is a secret (like a password). Set it on the machine running OpenClaw before messaging your agent.Terminal window export DISCORD_BOT_TOKEN="YOUR_BOT_TOKEN"openclaw config set channels.discord.token --ref-provider default --ref-source env --ref-id DISCORD_BOT_TOKEN --dry-runopenclaw config set channels.discord.token --ref-provider default --ref-source env --ref-id DISCORD_BOT_TOKENopenclaw config set channels.discord.enabled true --strict-jsonopenclaw gatewayIf OpenClaw is already running as a background service, restart it via the OpenClaw Mac app or by stopping and restarting the `openclaw gateway run` process.Configure OpenClaw and pair
Chat with your OpenClaw agent on any existing channel (e.g. Telegram) and tell it. If Discord is your first channel, use the CLI / config tab instead.
“I already set my Discord bot token in config. Please finish Discord setup with User ID `
and Server ID`.”
If you prefer file-based config, set:{channels: {discord: {enabled: true,token: {source: "env",provider: "default",id: "DISCORD_BOT_TOKEN",},},},}Env fallback for the default account:Terminal window DISCORD_BOT_TOKEN=...Plaintext `token` values are supported. SecretRef values are also supported for `channels.discord.token` across env/file/exec providers. See [Secrets Management](/en/gateway/secrets).Approve first DM pairing
Wait until the gateway is running, then DM your bot in Discord. It will respond with a pairing code.
Send the pairing code to your agent on your existing channel:
“Approve this Discord pairing code: `
`”
Pairing codes expire after 1 hour.
You should now be able to chat with your agent in Discord via DM.
Recommended: Set up a guild workspace
Section titled “Recommended: Set up a guild workspace”Once DMs are working, you can set up your Discord server as a full workspace where each channel gets its own agent session with its own context. This is recommended for private servers where it’s just you and your bot.
Add your server to the guild allowlist
This enables your agent to respond in any channel on your server, not just DMs.
“Add my Discord Server ID `
` to the guild allowlist”
{channels: {discord: {groupPolicy: "allowlist",guilds: {YOUR_SERVER_ID: {requireMention: true,users: ["YOUR_USER_ID"],},},},},}Allow responses without @mention
By default, your agent only responds in guild channels when @mentioned. For a private server, you probably want it to respond to every message.
“Allow my agent to respond on this server without having to be @mentioned”
Set `requireMention: false` in your guild config:{channels: {discord: {guilds: {YOUR_SERVER_ID: {requireMention: false,},},},},}Plan for memory in guild channels
By default, long-term memory (MEMORY.md) only loads in DM sessions. Guild channels do not auto-load MEMORY.md.
“When I ask questions in Discord channels, use memory_search or memory_get if you need long-term context from MEMORY.md.”
If you need shared context in every channel, put the stable instructions in
AGENTS.mdorUSER.md(they are injected for every session). Keep long-term notes inMEMORY.mdand access them on demand with memory tools.
Now create some channels on your Discord server and start chatting. Your agent can see the channel name, and each channel gets its own isolated session — so you can set up #coding, #home, #research, or whatever fits your workflow.
Runtime model
Section titled “Runtime model”- Gateway owns the Discord connection.
- Reply routing is deterministic: Discord inbound replies back to Discord.
- By default (
session.dmScope=main), direct chats share the agent main session (agent:main:main). - Guild channels are isolated session keys (
agent:<agentId>:discord:channel:<channelId>). - Group DMs are ignored by default (
channels.discord.dm.groupEnabled=false). - Native slash commands run in isolated command sessions (
agent:<agentId>:discord:slash:<userId>), while still carryingCommandTargetSessionKeyto the routed conversation session.
Forum channels
Section titled “Forum channels”Discord forum and media channels only accept thread posts. OpenClaw supports two ways to create them:
- Send a message to the forum parent (
channel:<forumId>) to auto-create a thread. The thread title uses the first non-empty line of your message. - Use
openclaw message thread createto create a thread directly. Do not pass--message-idfor forum channels.
Example: send to forum parent to create a thread
openclaw message send --channel discord --target channel:<forumId> \ --message "Topic title\nBody of the post"Example: create a forum thread explicitly
openclaw message thread create --channel discord --target channel:<forumId> \ --thread-name "Topic title" --message "Body of the post"Forum parents do not accept Discord components. If you need components, send to the thread itself (channel:<threadId>).
Interactive components
Section titled “Interactive components”OpenClaw supports Discord components v2 containers for agent messages. Use the message tool with a components payload. Interaction results are routed back to the agent as normal inbound messages and follow the existing Discord replyToMode settings.
Supported blocks:
text,section,separator,actions,media-gallery,file- Action rows allow up to 5 buttons or a single select menu
- Select types:
string,user,role,mentionable,channel
By default, components are single use. Set components.reusable=true to allow buttons, selects, and forms to be used multiple times until they expire.
To restrict who can click a button, set allowedUsers on that button (Discord user IDs, tags, or *). When configured, unmatched users receive an ephemeral denial.
The /model and /models slash commands open an interactive model picker with provider and model dropdowns plus a Submit step. The picker reply is ephemeral and only the invoking user can use it.
File attachments:
fileblocks must point to an attachment reference (attachment://<filename>)- Provide the attachment via
media/path/filePath(single file); usemedia-galleryfor multiple files - Use
filenameto override the upload name when it should match the attachment reference
Modal forms:
- Add
components.modalwith up to 5 fields - Field types:
text,checkbox,radio,select,role-select,user-select - OpenClaw adds a trigger button automatically
Example:
{ channel: "discord", action: "send", to: "channel:123456789012345678", message: "Optional fallback text", components: { reusable: true, text: "Choose a path", blocks: [ { type: "actions", buttons: [ { label: "Approve", style: "success", allowedUsers: ["123456789012345678"], }, { label: "Decline", style: "danger" }, ], }, { type: "actions", select: { type: "string", placeholder: "Pick an option", options: [ { label: "Option A", value: "a" }, { label: "Option B", value: "b" }, ], }, }, ], modal: { title: "Details", triggerLabel: "Open form", fields: [ { type: "text", label: "Requester" }, { type: "select", label: "Priority", options: [ { label: "Low", value: "low" }, { label: "High", value: "high" }, ], }, ], }, },}Access control and routing
Section titled “Access control and routing”channels.discord.dmPolicy controls DM access (legacy: channels.discord.dm.policy):
pairing(default)allowlistopen(requireschannels.discord.allowFromto include"*"; legacy:channels.discord.dm.allowFrom)disabled
If DM policy is not open, unknown users are blocked (or prompted for pairing in pairing mode).
Multi-account precedence:
channels.discord.accounts.default.allowFromapplies only to thedefaultaccount.- Named accounts inherit
channels.discord.allowFromwhen their ownallowFromis unset. - Named accounts do not inherit
channels.discord.accounts.default.allowFrom.
DM target format for delivery:
- `user:
-<@id>` mention
Bare numeric IDs are ambiguous and rejected unless an explicit user/channel target kind is provided.Guild handling is controlled by `channels.discord.groupPolicy`:
- `open`- `allowlist`- `disabled`
Secure baseline when `channels.discord` exists is `allowlist`.
`allowlist` behavior:
- guild must match `channels.discord.guilds` (`id` preferred, slug accepted)- optional sender allowlists: `users` (stable IDs recommended) and `roles` (role IDs only); if either is configured, senders are allowed when they match `users` OR `roles`- direct name/tag matching is disabled by default; enable `channels.discord.dangerouslyAllowNameMatching: true` only as break-glass compatibility mode- names/tags are supported for `users`, but IDs are safer; `openclaw security audit` warns when name/tag entries are used- if a guild has `channels` configured, non-listed channels are denied- if a guild has no `channels` block, all channels in that allowlisted guild are allowed
Example:{ channels: { discord: { groupPolicy: "allowlist", guilds: { "123456789012345678": { requireMention: true, ignoreOtherMentions: true, users: ["987654321098765432"], roles: ["123456789012345678"], channels: { general: { allow: true }, help: { allow: true, requireMention: true }, }, }, }, }, },}If you only set `DISCORD_BOT_TOKEN` and do not create a `channels.discord` block, runtime fallback is `groupPolicy="allowlist"` (with a warning in logs), even if `channels.defaults.groupPolicy` is `open`.Guild messages are mention-gated by default.
Mention detection includes:
- explicit bot mention
- configured mention patterns (
agents.list[].groupChat.mentionPatterns, fallbackmessages.groupChat.mentionPatterns) - implicit reply-to-bot behavior in supported cases
requireMention is configured per guild/channel (channels.discord.guilds...).
ignoreOtherMentions optionally drops messages that mention another user/role but not the bot (excluding @everyone/@here).
Group DMs:
- default: ignored (
dm.groupEnabled=false) - optional allowlist via
dm.groupChannels(channel IDs or slugs)
Role-based agent routing
Section titled “Role-based agent routing”Use bindings[].match.roles to route Discord guild members to different agents by role ID. Role-based bindings accept role IDs only and are evaluated after peer or parent-peer bindings and before guild-only bindings. If a binding also sets other match fields (for example peer + guildId + roles), all configured fields must match.
{ bindings: [ { agentId: "opus", match: { channel: "discord", guildId: "123456789012345678", roles: ["111111111111111111"], }, }, { agentId: "sonnet", match: { channel: "discord", guildId: "123456789012345678", }, }, ],}Developer Portal setup
Section titled “Developer Portal setup”Create app and bot
- Discord Developer Portal -> Applications -> New Application
- Bot -> Add Bot
- Copy bot token
Privileged intents
In Bot -> Privileged Gateway Intents, enable:
- Message Content Intent
- Server Members Intent (recommended)
Presence intent is optional and only required if you want to receive presence updates. Setting bot presence (setPresence) does not require enabling presence updates for members.
OAuth scopes and baseline permissions
OAuth URL generator:
- scopes:
bot,applications.commands
Typical baseline permissions:
- View Channels
- Send Messages
- Read Message History
- Embed Links
- Attach Files
- Add Reactions (optional)
Avoid Administrator unless explicitly needed.
Copy IDs
Enable Discord Developer Mode, then copy:
- server ID
- channel ID
- user ID
Prefer numeric IDs in OpenClaw config for reliable audits and probes.
Native commands and command auth
Section titled “Native commands and command auth”commands.nativedefaults to"auto"and is enabled for Discord.- Per-channel override:
channels.discord.commands.native. commands.native=falseexplicitly clears previously registered Discord native commands.- Native command auth uses the same Discord allowlists/policies as normal message handling.
- Commands may still be visible in Discord UI for users who are not authorized; execution still enforces OpenClaw auth and returns “not authorized”.
See Slash commands for command catalog and behavior.
Default slash command settings:
ephemeral: true
Feature details
Section titled “Feature details”Reply tags and native replies
Discord supports reply tags in agent output:
[[reply_to_current]]- `[[reply_to:
]]`
Controlled by `channels.discord.replyToMode`:
- `off` (default)- `first`- `all`
Note: `off` disables implicit reply threading. Explicit `[[reply_to_*]]` tags are still honored.
Message IDs are surfaced in context/history so agents can target specific messages.Live stream preview
OpenClaw can stream draft replies by sending a temporary message and editing it as text arrives.
- `channels.discord.streaming` controls preview streaming (`off` | `partial` | `block` | `progress`, default: `off`).- Default stays `off` because Discord preview edits can hit rate limits quickly, especially when multiple bots or gateways share the same account or guild traffic.- `progress` is accepted for cross-channel consistency and maps to `partial` on Discord.- `channels.discord.streamMode` is a legacy alias and is auto-migrated.- `partial` edits a single preview message as tokens arrive.- `block` emits draft-sized chunks (use `draftChunk` to tune size and breakpoints).
Example:{ channels: { discord: { streaming: "partial", }, },}`block` mode chunking defaults (clamped to `channels.discord.textChunkLimit`):{ channels: { discord: { streaming: "block", draftChunk: { minChars: 200, maxChars: 800, breakPreference: "paragraph", }, }, },}Preview streaming is text-only; media replies fall back to normal delivery.
Note: preview streaming is separate from block streaming. When block streaming is explicitlyenabled for Discord, OpenClaw skips the preview stream to avoid double streaming.History, context, and thread behavior
Guild history context:
channels.discord.historyLimitdefault20- fallback:
messages.groupChat.historyLimit 0disables
DM history controls:
channels.discord.dmHistoryLimit- `channels.discord.dms[”
“].historyLimit`
Thread behavior:
- Discord threads are routed as channel sessions- parent thread metadata can be used for parent-session linkage- thread config inherits parent channel config unless a thread-specific entry exists
Channel topics are injected as **untrusted** context (not as system prompt).Thread-bound sessions for subagents
Discord can bind a thread to a session target so follow-up messages in that thread keep routing to the same session (including subagent sessions).
Commands:
- `/focus
bind current/new thread to a subagent/session target -/unfocusremove current thread binding -/agentsshow active runs and binding state -/session idle
inspect/update inactivity auto-unfocus for focused bindings -/session max-age
` inspect/update hard max age for focused bindings
Config:{ session: { threadBindings: { enabled: true, idleHours: 24, maxAgeHours: 0, }, }, channels: { discord: { threadBindings: { enabled: true, idleHours: 24, maxAgeHours: 0, spawnSubagentSessions: false, // opt-in }, }, },}Notes:
- `session.threadBindings.*` sets global defaults.- `channels.discord.threadBindings.*` overrides Discord behavior.- `spawnSubagentSessions` must be true to auto-create/bind threads for `sessions_spawn({ thread: true })`.- `spawnAcpSessions` must be true to auto-create/bind threads for ACP (`/acp spawn ... --thread ...` or `sessions_spawn({ runtime: "acp", thread: true })`).- If thread bindings are disabled for an account, `/focus` and related thread binding operations are unavailable.
See [Sub-agents](/en/tools/subagents), [ACP Agents](/en/tools/acp-agents), and [Configuration Reference](/en/gateway/configuration-reference).Persistent ACP channel bindings
For stable "always-on" ACP workspaces, configure top-level typed ACP bindings targeting Discord conversations.
Config path:
- `bindings[]` with `type: "acp"` and `match.channel: "discord"`
Example:{ agents: { list: [ { id: "codex", runtime: { type: "acp", acp: { agent: "codex", backend: "acpx", mode: "persistent", cwd: "/workspace/openclaw", }, }, }, ], }, bindings: [ { type: "acp", agentId: "codex", match: { channel: "discord", accountId: "default", peer: { kind: "channel", id: "222222222222222222" }, }, acp: { label: "codex-main" }, }, ], channels: { discord: { guilds: { "111111111111111111": { channels: { "222222222222222222": { requireMention: false, }, }, }, }, }, },}Notes:
- `/acp spawn codex --bind here` binds the current Discord channel or thread in place and keeps future messages routed to the same ACP session.- That can still mean "start a fresh Codex ACP session", but it does not create a new Discord thread by itself. The existing channel stays the chat surface.- Codex may still run in its own `cwd` or backend workspace on disk. That workspace is runtime state, not a Discord thread.- Thread messages can inherit the parent channel ACP binding.- In a bound channel or thread, `/new` and `/reset` reset the same ACP session in place.- Temporary thread bindings still work and can override target resolution while active.- `spawnAcpSessions` is only required when OpenClaw needs to create/bind a child thread via `--thread auto|here`. It is not required for `/acp spawn ... --bind here` in the current channel.
See [ACP Agents](/en/tools/acp-agents) for binding behavior details.Reaction notifications
Per-guild reaction notification mode:
offown(default)allallowlist(uses `guilds.
.users`)
Reaction events are turned into system events and attached to the routed Discord session.Ack reactions
ackReaction sends an acknowledgement emoji while OpenClaw is processing an inbound message.
Resolution order:
- `channels.discord.accounts.
.ackReaction -channels.discord.ackReaction -messages.ackReaction - agent identity emoji fallback (agents.list[].identity.emoji`, else ”👀”)
Notes:
- Discord accepts unicode emoji or custom emoji names.- Use `""` to disable the reaction for a channel or account.Config writes
Channel-initiated config writes are enabled by default.
This affects `/config set|unset` flows (when command features are enabled).
Disable:{ channels: { discord: { configWrites: false, }, },}Gateway proxy
Route Discord gateway WebSocket traffic and startup REST lookups (application ID + allowlist resolution) through an HTTP(S) proxy with `channels.discord.proxy`.{ channels: { discord: { proxy: "http://proxy.example:8080", }, },}Per-account override:{ channels: { discord: { accounts: { primary: { proxy: "http://proxy.example:8080", }, }, }, },}PluralKit support
Enable PluralKit resolution to map proxied messages to system member identity:{ channels: { discord: { pluralkit: { enabled: true, token: "pk_live_...", // optional; needed for private systems }, }, },}Notes:
- allowlists can use `pk: - member display names are matched by name/slug only whenchannels.discord.dangerouslyAllowNameMatching: true - lookups use original message ID and are time-window constrained - if lookup fails, proxied messages are treated as bot messages and dropped unlessallowBots=true`
Presence configuration
Presence updates are applied when you set a status or activity field, or when you enable auto presence.
Status only example:{ channels: { discord: { status: "idle", }, },}Activity example (custom status is the default activity type):{ channels: { discord: { activity: "Focus time", activityType: 4, }, },}Streaming example:{ channels: { discord: { activity: "Live coding", activityType: 1, activityUrl: "https://twitch.tv/openclaw", }, },}Activity type map:
- 0: Playing- 1: Streaming (requires `activityUrl`)- 2: Listening- 3: Watching- 4: Custom (uses the activity text as the status state; emoji is optional)- 5: Competing
Auto presence example (runtime health signal):{ channels: { discord: { autoPresence: { enabled: true, intervalMs: 30000, minUpdateIntervalMs: 15000, exhaustedText: "token exhausted", }, }, },}Auto presence maps runtime availability to Discord status: healthy => online, degraded or unknown => idle, exhausted or unavailable => dnd. Optional text overrides:
- `autoPresence.healthyText`- `autoPresence.degradedText`- `autoPresence.exhaustedText` (supports `{reason}` placeholder)Exec approvals in Discord
Discord supports button-based exec approvals in DMs and can optionally post approval prompts in the originating channel.
Config path:
channels.discord.execApprovals.enabledchannels.discord.execApprovals.approvers(optional; falls back to owner IDs inferred fromallowFromand explicit DMdefaultTowhen possible)channels.discord.execApprovals.target(dm|channel|both, default:dm)agentFilter,sessionFilter,cleanupAfterResolve
Discord auto-enables native exec approvals when enabled is unset or "auto" and at least one approver can be resolved, either from execApprovals.approvers or from the account’s existing owner config (allowFrom, legacy dm.allowFrom, or explicit DM defaultTo). Set enabled: false to disable Discord as a native approval client explicitly.
When target is channel or both, the approval prompt is visible in the channel. Only resolved approvers can use the buttons; other users receive an ephemeral denial. Approval prompts include the command text, so only enable channel delivery in trusted channels. If the channel ID cannot be derived from the session key, OpenClaw falls back to DM delivery.
Discord also renders the shared approval buttons used by other chat channels. The native Discord adapter mainly adds approver DM routing and channel fanout.
Gateway auth for this handler uses the same shared credential resolution contract as other Gateway clients:
- env-first local auth (
OPENCLAW_GATEWAY_TOKEN/OPENCLAW_GATEWAY_PASSWORDthengateway.auth.*) - in local mode,
gateway.remote.*can be used as fallback only whengateway.auth.*is unset; configured-but-unresolved local SecretRefs fail closed - remote-mode support via
gateway.remote.*when applicable - URL overrides are override-safe: CLI overrides do not reuse implicit credentials, and env overrides use env credentials only
Exec approvals expire after 30 minutes by default. If approvals fail with unknown approval IDs, verify approver resolution and feature enablement.
Related docs: Exec approvals
Tools and action gates
Section titled “Tools and action gates”Discord message actions include messaging, channel admin, moderation, presence, and metadata actions.
Core examples:
- messaging:
sendMessage,readMessages,editMessage,deleteMessage,threadReply - reactions:
react,reactions,emojiList - moderation:
timeout,kick,ban - presence:
setPresence
Action gates live under channels.discord.actions.*.
Default gate behavior:
| Action group | Default |
|---|---|
| reactions, messages, threads, pins, polls, search, memberInfo, roleInfo, channelInfo, channels, voiceStatus, events, stickers, emojiUploads, stickerUploads, permissions | enabled |
| roles | disabled |
| moderation | disabled |
| presence | disabled |
Components v2 UI
Section titled “Components v2 UI”OpenClaw uses Discord components v2 for exec approvals and cross-context markers. Discord message actions can also accept components for custom UI (advanced; requires constructing a component payload via the discord tool), while legacy embeds remain available but are not recommended.
channels.discord.ui.components.accentColorsets the accent color used by Discord component containers (hex).- Set per account with
channels.discord.accounts.<id>.ui.components.accentColor. embedsare ignored when components v2 are present.
Example:
{ channels: { discord: { ui: { components: { accentColor: "#5865F2", }, }, }, },}Voice channels
Section titled “Voice channels”OpenClaw can join Discord voice channels for realtime, continuous conversations. This is separate from voice message attachments.
Requirements:
- Enable native commands (
commands.nativeorchannels.discord.commands.native). - Configure
channels.discord.voice. - The bot needs Connect + Speak permissions in the target voice channel.
Use the Discord-only native command /vc join|leave|status to control sessions. The command uses the account default agent and follows the same allowlist and group policy rules as other Discord commands.
Auto-join example:
{ channels: { discord: { voice: { enabled: true, autoJoin: [ { guildId: "123456789012345678", channelId: "234567890123456789", }, ], daveEncryption: true, decryptionFailureTolerance: 24, tts: { provider: "openai", openai: { voice: "alloy" }, }, }, }, },}Notes:
voice.ttsoverridesmessages.ttsfor voice playback only.- Voice transcript turns derive owner status from Discord
allowFrom(ordm.allowFrom); non-owner speakers cannot access owner-only tools (for examplegatewayandcron). - Voice is enabled by default; set
channels.discord.voice.enabled=falseto disable it. voice.daveEncryptionandvoice.decryptionFailureTolerancepass through to@discordjs/voicejoin options.@discordjs/voicedefaults aredaveEncryption=trueanddecryptionFailureTolerance=24if unset.- OpenClaw also watches receive decrypt failures and auto-recovers by leaving/rejoining the voice channel after repeated failures in a short window.
- If receive logs repeatedly show
DecryptionFailed(UnencryptedWhenPassthroughDisabled), this may be the upstream@discordjs/voicereceive bug tracked in discord.js #11419.
Voice messages
Section titled “Voice messages”Discord voice messages show a waveform preview and require OGG/Opus audio plus metadata. OpenClaw generates the waveform automatically, but it needs ffmpeg and ffprobe available on the gateway host to inspect and convert audio files.
Requirements and constraints:
- Provide a local file path (URLs are rejected).
- Omit text content (Discord does not allow text + voice message in the same payload).
- Any audio format is accepted; OpenClaw converts to OGG/Opus when needed.
Example:
message(action="send", channel="discord", target="channel:123", path="/path/to/audio.mp3", asVoice=true)Troubleshooting
Section titled “Troubleshooting”Used disallowed intents or bot sees no guild messages
- enable Message Content Intent
- enable Server Members Intent when you depend on user/member resolution
- restart gateway after changing intents
Guild messages blocked unexpectedly
- verify `groupPolicy`- verify guild allowlist under `channels.discord.guilds`- if guild `channels` map exists, only listed channels are allowed- verify `requireMention` behavior and mention patterns
Useful checks:openclaw doctoropenclaw channels status --probeopenclaw logs --followRequire mention false but still blocked
Common causes:
groupPolicy="allowlist"without matching guild/channel allowlistrequireMentionconfigured in the wrong place (must be underchannels.discord.guildsor channel entry)- sender blocked by guild/channel
usersallowlist
Long-running handlers time out or duplicate replies
Typical logs:
Listener DiscordMessageListener timed out after 30000ms for event MESSAGE_CREATESlow listener detected ...discord inbound worker timed out after ...
Listener budget knob:
- single-account:
channels.discord.eventQueue.listenerTimeout - multi-account: `channels.discord.accounts.
.eventQueue.listenerTimeout`
Worker run timeout knob:
- single-account: `channels.discord.inboundWorker.runTimeoutMs`- multi-account: `channels.discord.accounts..inboundWorker.runTimeoutMs - default:1800000(30 minutes); set0` to disable
Recommended baseline:{ channels: { discord: { accounts: { default: { eventQueue: { listenerTimeout: 120000, }, inboundWorker: { runTimeoutMs: 1800000, }, }, }, }, },}Use `eventQueue.listenerTimeout` for slow listener setup and `inboundWorker.runTimeoutMs`only if you want a separate safety valve for queued agent turns.Permissions audit mismatches
channels status --probe permission checks only work for numeric channel IDs.
If you use slug keys, runtime matching can still work, but probe cannot fully verify permissions.
DM and pairing issues
- DM disabled:
channels.discord.dm.enabled=false - DM policy disabled:
channels.discord.dmPolicy="disabled"(legacy:channels.discord.dm.policy) - awaiting pairing approval in
pairingmode
Bot to bot loops
By default bot-authored messages are ignored.
If you set channels.discord.allowBots=true, use strict mention and allowlist rules to avoid loop behavior.
Prefer channels.discord.allowBots="mentions" to only accept bot messages that mention the bot.
Voice STT drops with DecryptionFailed(...)
- keep OpenClaw current (
openclaw update) so the Discord voice receive recovery logic is present - confirm
channels.discord.voice.daveEncryption=true(default) - start from
channels.discord.voice.decryptionFailureTolerance=24(upstream default) and tune only if needed - watch logs for:
discord voice: DAVE decrypt failures detecteddiscord voice: repeated decrypt failures; attempting rejoin
- if failures continue after automatic rejoin, collect logs and compare against discord.js #11419
Configuration reference pointers
Section titled “Configuration reference pointers”Primary reference:
High-signal Discord fields:
- startup/auth:
enabled,token,accounts.*,allowBots - policy:
groupPolicy,dm.*,guilds.*,guilds.*.channels.* - command:
commands.native,commands.useAccessGroups,configWrites,slashCommand.* - event queue:
eventQueue.listenerTimeout(listener budget),eventQueue.maxQueueSize,eventQueue.maxConcurrency - inbound worker:
inboundWorker.runTimeoutMs - reply/history:
replyToMode,historyLimit,dmHistoryLimit,dms.*.historyLimit - delivery:
textChunkLimit,chunkMode,maxLinesPerMessage - streaming:
streaming(legacy alias:streamMode),draftChunk,blockStreaming,blockStreamingCoalesce - media/retry:
mediaMaxMb,retrymediaMaxMbcaps outbound Discord uploads (default:8MB)
- actions:
actions.* - presence:
activity,status,activityType,activityUrl - UI:
ui.components.accentColor - features:
threadBindings, top-levelbindings[](type: "acp"),pluralkit,execApprovals,intents,agentComponents,heartbeat,responsePrefix
Safety and operations
Section titled “Safety and operations”- Treat bot tokens as secrets (
DISCORD_BOT_TOKENpreferred in supervised environments). - Grant least-privilege Discord permissions.
- If command deploy/state is stale, restart gateway and re-check with
openclaw channels status --probe.