已準備好透過官方 Discord gateway 用於 DM 和伺服器頻道。Documentation Index
Fetch the complete documentation index at: https://docs.openclaw.ai/llms.txt
Use this file to discover all available pages before exploring further.
Pairing
Slash commands
Channel troubleshooting
快速設定
你需要建立一個帶有機器人的新應用程式、將機器人加入你的伺服器,並將它與 OpenClaw 配對。建議將你的機器人加入你自己的私人伺服器。如果你還沒有伺服器,請先建立一個(選擇 Create My Own > For me and my friends)。Create a Discord application and bot
Enable privileged intents
- Message Content Intent(必要)
- Server Members Intent(建議;角色允許清單與名稱對 ID 比對需要)
- Presence Intent(選用;只有狀態更新需要)
Copy your bot token
Generate an invite URL and add the bot to your server
botapplications.commands
- View Channels Text Permissions
- Send Messages
- Read Message History
- Embed Links
- Attach Files
- Add Reactions(選用)
Enable Developer Mode and collect your IDs
- 按一下 User Settings(你頭像旁的齒輪圖示)→ Advanced → 開啟 Developer Mode
- 在側邊欄中的 server icon 上按右鍵 → Copy Server ID
- 在你的 own avatar 上按右鍵 → Copy User ID
Allow DMs from server members
Set your bot token securely (do not send it in chat)
openclaw gateway run 程序。
對於受管理的服務安裝,請從存在 DISCORD_BOT_TOKEN 的 shell 執行 openclaw gateway install,或將變數儲存在 ~/.openclaw/.env,讓服務在重新啟動後可以解析 env SecretRef。
如果你的主機遭 Discord 的啟動應用程式查詢封鎖或限速,請從 Developer Portal 設定 Discord application/client ID,讓啟動流程可以略過該 REST 呼叫。預設帳戶請使用 channels.discord.applicationId;若你執行多個 Discord 機器人,請使用 channels.discord.accounts.<accountId>.applicationId。Configure OpenClaw and pair
- Ask your agent
- CLI / config
「我已經在 config 中設定 Discord 機器人 token。請使用 User ID<user_id>和 Server ID<server_id>完成 Discord 設定。」
DISCORD_BOT_TOKEN 只會用於預設帳戶。
如果兩個已啟用的 Discord 帳戶解析到相同的機器人 token,OpenClaw 只會為該 token 啟動一個 gateway 監視器。來自 config 的 token 優先於預設 env 後援;否則第一個已啟用帳戶勝出,重複的帳戶會被回報為已停用。
對於進階的對外呼叫(message tool/channel actions),明確的逐次呼叫 token 會用於該呼叫。這適用於 send 與 read/probe 類動作(例如 read/search/fetch/thread/pins/permissions)。帳戶 policy/retry 設定仍然來自作用中執行階段快照中選取的帳戶。建議:設定伺服器工作區
DM 正常運作後,你可以將 Discord 伺服器設定為完整工作區,其中每個頻道都有自己的 agent session 與獨立 context。這建議用於只有你和機器人的私人伺服器。Add your server to the guild allowlist
- Ask your agent
- Config
「將我的 Discord Server ID <server_id> 加入伺服器允許清單」
Allow responses without @mention
message tool 明確傳送,因此 agent 預設可以旁觀,並只在判斷頻道回覆有用時才發文。這代表所選模型必須可靠地呼叫工具。如果 Discord 顯示正在輸入,且記錄顯示 token 用量,但沒有發出訊息,請檢查 session log 中是否有 didSendViaMessagingTool: false 的 assistant 文字。這表示模型產生的是私密的最終答案,而不是呼叫 message(action=send)。請切換到更強的工具呼叫模型,或使用下方 config 還原舊版自動最終回覆。- Ask your agent
- Config
「允許我的 agent 在這個伺服器上回應,而不需要被 @提及」
#coding、#home、#research,或任何符合你工作流程的頻道。
執行階段模型
- Gateway 擁有 Discord 連線。
- 回覆路由是確定性的:Discord 入站回覆會回到 Discord。
- Discord 伺服器/頻道中繼資料會作為不受信任的 情境加入模型提示,而不是作為使用者可見的回覆前綴。如果模型將該封套 複製回來,OpenClaw 會從出站回覆和 未來的重播情境中移除被複製的中繼資料。
- 預設情況下(
session.dmScope=main),直接聊天會共用代理的主要工作階段(agent:main:main)。 - 伺服器頻道使用隔離的工作階段鍵(
agent:<agentId>:discord:channel:<channelId>)。 - 群組私訊預設會被忽略(
channels.discord.dm.groupEnabled=false)。 - 原生斜線命令會在隔離的命令工作階段中執行(
agent:<agentId>:discord:slash:<userId>),同時仍攜帶CommandTargetSessionKey到已路由的對話工作階段。 - 純文字 cron/heartbeat 對 Discord 的公告傳送,只會使用一次最終的 助理可見答案。當代理發出多個可傳送承載時,媒體和結構化元件承載仍會 保持為多則訊息。
論壇頻道
Discord 論壇和媒體頻道只接受討論串貼文。OpenClaw 支援兩種建立方式:- 傳送訊息到論壇父層(
channel:<forumId>)以自動建立討論串。討論串標題會使用你訊息中的第一個非空白行。 - 使用
openclaw message thread create直接建立討論串。請勿對論壇頻道傳入--message-id。
channel:<threadId>)。
互動式元件
OpenClaw 支援用於代理訊息的 Discord 元件 v2 容器。請使用訊息工具並帶上components 承載。互動結果會作為一般入站訊息路由回代理,並遵循現有的 Discord replyToMode 設定。
支援的區塊:
text、section、separator、actions、media-gallery、file- 動作列最多允許 5 個按鈕或單一選取選單
- 選取類型:
string、user、role、mentionable、channel
components.reusable=true 可允許按鈕、選取項目和表單在到期前多次使用。
若要限制誰可以點擊按鈕,請在該按鈕上設定 allowedUsers(Discord 使用者 ID、標籤或 *)。設定後,不符合的使用者會收到一則僅自己可見的拒絕訊息。
/model 和 /models 斜線命令會開啟互動式模型選擇器,其中包含提供者、模型和相容執行階段下拉選單,以及提交步驟。/models add 已棄用,現在會回傳棄用訊息,而不是從聊天中註冊模型。選擇器回覆僅自己可見,且只有呼叫的使用者可以使用它。
檔案附件:
file區塊必須指向附件參照(attachment://<filename>)- 透過
media/path/filePath提供附件(單一檔案);多個檔案請使用media-gallery - 當上傳名稱需要符合附件參照時,使用
filename覆寫上傳名稱
- 新增
components.modal,最多可包含 5 個欄位 - 欄位類型:
text、checkbox、radio、select、role-select、user-select - OpenClaw 會自動新增觸發按鈕
存取控制與路由
- DM policy
- DM access groups
- Guild policy
- Mentions and group DMs
channels.discord.dmPolicy 控制私訊存取。channels.discord.allowFrom 是正式的私訊允許清單。pairing(預設)allowlistopen(需要channels.discord.allowFrom包含"*")disabled
pairing 模式中被提示配對)。多帳號優先順序:channels.discord.accounts.default.allowFrom只套用於default帳號。- 對單一帳號而言,
allowFrom的優先順序高於舊版dm.allowFrom。 - 具名帳號在自身的
allowFrom和舊版dm.allowFrom未設定時,會繼承channels.discord.allowFrom。 - 具名帳號不會繼承
channels.discord.accounts.default.allowFrom。
channels.discord.dm.policy 和 channels.discord.dm.allowFrom。openclaw doctor --fix 會在不變更存取權的前提下,將它們遷移到 dmPolicy 和 allowFrom。用於傳送的私訊目標格式:user:<id><@id>提及
allowFrom 中的 ID 會為了相容性被視為使用者私訊目標。以角色為基礎的代理路由
使用bindings[].match.roles 依角色 ID 將 Discord 伺服器成員路由到不同代理。以角色為基礎的繫結只接受角色 ID,並會在對等或父層對等繫結之後、僅伺服器繫結之前評估。如果繫結也設定其他比對欄位(例如 peer + guildId + roles),所有已設定欄位都必須相符。
原生命令和命令驗證
commands.native預設為"auto",並已為 Discord 啟用。- 每頻道覆寫:
channels.discord.commands.native。 commands.native=false會在啟動期間略過 Discord 斜線指令註冊與清理。先前註冊的指令可能仍會在 Discord 中可見,直到你從 Discord app 移除它們。- 原生指令驗證使用與一般訊息處理相同的 Discord 允許清單/政策。
- 對於未授權的使用者,指令可能仍會顯示在 Discord UI 中;執行時仍會強制套用 OpenClaw 驗證,並傳回「未授權」。
ephemeral: true
功能詳細資料
Reply tags and native replies
Reply tags and native replies
Live stream preview
Live stream preview
channels.discord.streaming 接受 off | partial | block | progress(預設)。progress 會保留一則可編輯的狀態草稿,並以工具進度更新它直到最終送達;streamMode 是舊版執行階段別名。執行 openclaw doctor --fix,將保存的設定改寫為標準鍵。將 channels.discord.streaming.mode 設為 off 可停用 Discord 預覽編輯。如果已明確啟用 Discord 區塊串流,OpenClaw 會略過預覽串流以避免雙重串流。partial會在 token 抵達時編輯單一預覽訊息。block會輸出草稿大小的區塊(使用draftChunk調整大小與斷點,並限制在textChunkLimit內)。- 媒體、錯誤與明確回覆的最終訊息會取消待處理的預覽編輯。
streaming.preview.toolProgress(預設true)控制工具/進度更新是否重用預覽訊息。streaming.preview.commandText/streaming.progress.commandText控制精簡進度列中的指令/執行詳細資料:raw(預設)或status(僅工具標籤)。
block 串流時,OpenClaw 會略過預覽串流以避免雙重串流。History, context, and thread behavior
History, context, and thread behavior
channels.discord.historyLimit預設20- 後援:
messages.groupChat.historyLimit 0會停用
channels.discord.dmHistoryLimitchannels.discord.dms["<user_id>"].historyLimit
- Discord 討論串會作為頻道工作階段路由,並繼承父頻道設定,除非被覆寫。
- 討論串工作階段會繼承父頻道的工作階段層級
/model選擇,作為僅模型的後援;討論串本機的/model選擇仍有優先權,且除非啟用逐字稿繼承,否則不會複製父逐字稿歷史記錄。 channels.discord.thread.inheritParent(預設false)讓新的自動討論串選擇從父逐字稿播種。每帳號覆寫位於channels.discord.accounts.<id>.thread.inheritParent。- 訊息工具反應可以解析
user:<id>DM 目標。 guilds.<guild>.channels.<channel>.requireMention: false會在回覆階段啟用後援期間保留。
Thread-bound sessions for subagents
Thread-bound sessions for subagents
/focus <target>將目前/新討論串繫結到子代理/工作階段目標/unfocus移除目前討論串繫結/agents顯示作用中的執行與繫結狀態/session idle <duration|off>檢查/更新聚焦繫結的不活動自動取消聚焦/session max-age <duration|off>檢查/更新聚焦繫結的硬性最長存留時間
session.threadBindings.*會設定全域預設值。channels.discord.threadBindings.*會覆寫 Discord 行為。spawnSessions控制sessions_spawn({ thread: true })與 ACP 討論串產生的自動建立/繫結討論串。預設:true。defaultSpawnContext控制討論串繫結產生的原生子代理內容。預設:"fork"。- 已棄用的
spawnSubagentSessions/spawnAcpSessions鍵會由openclaw doctor --fix遷移。 - 如果帳號已停用討論串繫結,
/focus與相關討論串繫結操作將無法使用。
Persistent ACP channel bindings
Persistent ACP channel bindings
bindings[],搭配type: "acp"與match.channel: "discord"
/acp spawn codex --bind here會就地繫結目前頻道或討論串,並讓未來訊息保留在相同 ACP 工作階段。討論串訊息會繼承父頻道繫結。- 在已繫結的頻道或討論串中,
/new與/reset會就地重設相同 ACP 工作階段。暫時討論串繫結可在作用中時覆寫目標解析。 spawnSessions會控管透過--thread auto|here建立/繫結子討論串。
Reaction notifications
Reaction notifications
offown(預設)allallowlist(使用guilds.<id>.users)
Ack reactions
Ack reactions
ackReaction 會在 OpenClaw 處理傳入訊息時傳送確認表情符號。解析順序:channels.discord.accounts.<accountId>.ackReactionchannels.discord.ackReactionmessages.ackReaction- 代理身分表情符號後援(
agents.list[].identity.emoji,否則為 ”👀”)
- Discord 接受 unicode 表情符號或自訂表情符號名稱。
- 使用
""可停用某個頻道或帳號的反應。
Config writes
Config writes
/config set|unset 流程(當指令功能已啟用時)。停用:Gateway proxy
Gateway proxy
channels.discord.proxy 路由 Discord gateway WebSocket 流量與啟動 REST 查詢(應用程式 ID + 允許清單解析)。PluralKit support
PluralKit support
- 允許清單可使用
pk:<memberId> - 只有在
channels.discord.dangerouslyAllowNameMatching: true時,才會依名稱/slug 比對成員顯示名稱 - 查詢會使用原始訊息 ID,並受時間範圍限制
- 如果查詢失敗,代理訊息會被視為 bot 訊息並丟棄,除非
allowBots=true
Outbound mention aliases
Outbound mention aliases
mentionAliases。鍵是不含前置 @ 的控制代碼;值是 Discord 使用者 ID。未知控制代碼、@everyone、@here,以及 Markdown 程式碼範圍內的提及都會保持不變。Presence configuration
Presence configuration
- 0:正在玩
- 1:正在串流(需要
activityUrl) - 2:正在聆聽
- 3:正在觀看
- 4:自訂(使用活動文字作為狀態;表情符號為選用)
- 5:正在競賽
autoPresence.healthyTextautoPresence.degradedTextautoPresence.exhaustedText(支援{reason}placeholder)
Approvals in Discord
Approvals in Discord
channels.discord.execApprovals.enabledchannels.discord.execApprovals.approvers(選用;可行時會回退到commands.ownerAllowFrom)channels.discord.execApprovals.target(dm|channel|both,預設:dm)agentFilter、sessionFilter、cleanupAfterResolve
enabled 未設定或為 "auto",且至少可從 execApprovals.approvers 或 commands.ownerAllowFrom 解析出一位核准者時,Discord 會自動啟用原生 exec 核准。Discord 不會從頻道 allowFrom、舊版 dm.allowFrom,或 direct-message defaultTo 推斷 exec 核准者。設定 enabled: false 可明確停用 Discord 作為原生核准用戶端。對於 /diagnostics 和 /export-trajectory 等敏感的 owner-only 群組命令,OpenClaw 會私下傳送核准提示和最終結果。當發起命令的擁有者有 Discord 擁有者路由時,它會先嘗試 Discord DM;若無法使用,則回退到 commands.ownerAllowFrom 中第一個可用的擁有者路由,例如 Telegram。當 target 為 channel 或 both 時,核准提示會在頻道中可見。只有已解析的核准者可以使用按鈕;其他使用者會收到短暫的拒絕訊息。核准提示包含命令文字,因此只有在可信任的頻道中才應啟用頻道傳遞。若無法從 session key 推導出頻道 ID,OpenClaw 會回退到 DM 傳遞。Discord 也會呈現其他聊天頻道使用的共用核准按鈕。原生 Discord adapter 主要新增核准者 DM 路由和頻道 fanout。
當這些按鈕存在時,它們是主要的核准 UX;OpenClaw
只有在工具結果表示聊天核准無法使用,或手動核准是唯一途徑時,
才應包含手動 /approve 命令。
如果 Discord 原生核准執行階段未啟用,OpenClaw 會保留
本機 deterministic /approve <id> <decision> 提示可見。如果
執行階段已啟用,但原生卡片無法傳遞到任何目標,
OpenClaw 會在同一聊天中傳送備援通知,內含待處理核准中的確切 /approve
命令。Gateway 驗證和核准解析遵循共用 Gateway client contract(plugin: ID 會透過 plugin.approval.resolve 解析;其他 ID 會透過 exec.approval.resolve 解析)。核准預設會在 30 分鐘後過期。請參閱 Exec approvals。工具與動作閘門
Discord 訊息動作包含訊息、頻道管理、管理、狀態與中繼資料動作。 核心範例:- 訊息:
sendMessage、readMessages、editMessage、deleteMessage、threadReply - reactions:
react、reactions、emojiList - 管理:
timeout、kick、ban - 狀態:
setPresence
event-create 動作接受選用的 image 參數(URL 或本機檔案路徑),用來設定預定活動封面圖片。
動作閘門位於 channels.discord.actions.* 下。
預設閘門行為:
| 動作群組 | 預設 |
|---|---|
| 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
OpenClaw 會將 Discord components v2 用於 exec 核准和跨情境標記。Discord 訊息動作也可以接受components 以提供自訂 UI(進階;需要透過 discord 工具建構 component payload),而舊版 embeds 仍可使用,但不建議使用。
channels.discord.ui.components.accentColor會設定 Discord component 容器使用的強調色(十六進位)。- 使用
channels.discord.accounts.<id>.ui.components.accentColor逐帳號設定。 - 當 components v2 存在時,
embeds會被忽略。
語音
Discord 有兩種不同的語音介面:即時 voice channels(連續對話)和 voice message attachments(波形預覽格式)。gateway 兩者都支援。語音頻道
設定檢查清單:- 在 Discord Developer Portal 中啟用 Message Content Intent。
- 使用角色/使用者 allowlist 時,啟用 Server Members Intent。
- 使用
bot和applications.commandsscope 邀請 bot。 - 在目標語音頻道中授予 Connect、Speak、Send Messages 和 Read Message History。
- 啟用原生命令(
commands.native或channels.discord.commands.native)。 - 設定
channels.discord.voice。
/vc join|leave|status 控制 session。該命令使用帳號的預設 agent,並遵循與其他 Discord 命令相同的 allowlist 和群組 policy 規則。
voice.tts只會覆寫語音播放的messages.tts。voice.model只會覆寫 Discord 語音頻道回應使用的 LLM。保持未設定即可繼承已路由的 agent model。- STT 使用
tools.media.audio;voice.model不影響轉錄。 - 逐頻道 Discord
systemPrompt覆寫會套用到該語音頻道的語音 transcript turns。 - 語音 transcript turns 會從 Discord
allowFrom(或dm.allowFrom)衍生擁有者狀態;非擁有者說話者無法存取 owner-only 工具(例如gateway和cron)。 - Discord 語音對純文字設定採 opt-in;設定
channels.discord.voice.enabled=true(或保留既有的channels.discord.voice區塊)即可啟用/vc命令、語音執行階段和GuildVoiceStatesgateway intent。 channels.discord.intents.voiceStates可以明確覆寫 voice-state intent 訂閱。保持未設定時,intent 會依有效的語音啟用狀態而定。voice.daveEncryption和voice.decryptionFailureTolerance會傳遞到@discordjs/voicejoin options。- 若未設定,
@discordjs/voice預設為daveEncryption=true和decryptionFailureTolerance=24。 voice.connectTimeoutMs控制/vc join和自動加入嘗試的初始@discordjs/voiceReady 等待時間。預設:30000。voice.reconnectGraceMs控制 OpenClaw 在中斷連線的語音 session 開始重新連線前,等待多久才銷毀它。預設:15000。- 語音播放不會只因為另一位使用者開始說話而停止。為避免回授迴圈,OpenClaw 會在 TTS 播放期間忽略新的語音擷取;請在播放結束後再說話以進入下一輪。
voice.captureSilenceGraceMs控制 Discord 回報說話者停止後,OpenClaw 等待多久才會完成該音訊片段並送往 STT。預設:2500;若 Discord 將正常停頓切成不連貫的部分 transcript,請提高此值。- 當 ElevenLabs 是選定的 TTS provider 時,Discord 語音播放會使用 streaming TTS,並從 provider response stream 開始。不支援 streaming 的 provider 會回退到合成的暫存檔路徑。
- OpenClaw 也會監看接收解密失敗,並在短時間內反覆失敗後透過離開/重新加入語音頻道自動復原。
- 如果更新後接收記錄反覆顯示
DecryptionFailed(UnencryptedWhenPassthroughDisabled),請收集 dependency report 和 logs。隨附的@discordjs/voiceline 包含 discord.js PR #11449 的 upstream padding fix,該修正關閉了 discord.js issue #11419。 The operation was abortedreceive events 是 OpenClaw 完成擷取說話者片段時的預期事件;它們是詳細診斷,而非警告。
- Discord PCM 擷取會轉換為 WAV 暫存檔。
tools.media.audio處理 STT,例如openai/gpt-4o-mini-transcribe。- transcript 會透過 Discord ingress 和 routing 傳送,同時 response LLM 會以 voice-output policy 執行,該 policy 會隱藏 agent
tts工具並要求回傳文字,因為 Discord 語音擁有最終 TTS 播放。 - 設定
voice.model時,只會覆寫此語音頻道回合的 response LLM。 voice.tts會合併到messages.tts之上;支援 streaming 的 provider 會直接供給 player,否則會在已加入的頻道中播放產生的音訊檔。
voice.model 的 LLM route auth、tools.media.audio 的 STT auth,以及 messages.tts/voice.tts 的 TTS auth。
語音訊息
Discord 語音訊息會顯示波形預覽,並需要 OGG/Opus 音訊。OpenClaw 會自動產生波形,但 gateway host 上需要ffmpeg 和 ffprobe 來檢查和轉換。
- 提供 本機檔案路徑(URL 會被拒絕)。
- 省略文字內容(Discord 會拒絕同一 payload 中同時包含文字 + 語音訊息)。
- 任何音訊格式都可接受;OpenClaw 會視需要轉換為 OGG/Opus。
疑難排解
Used disallowed intents or bot sees no guild messages
Used disallowed intents or bot sees no guild messages
- 啟用 Message Content Intent
- 當你依賴使用者/成員解析時,啟用 Server Members Intent
- 變更 intents 後重新啟動 gateway
Guild messages blocked unexpectedly
Guild messages blocked unexpectedly
- 驗證
groupPolicy - 驗證
channels.discord.guilds下的 guild allowlist - 如果 guild
channelsmap 存在,則只允許列出的頻道 - 驗證
requireMention行為和提及模式
提及要求為 false 但仍遭封鎖
提及要求為 false 但仍遭封鎖
groupPolicy="allowlist"沒有相符的 guild/channel 允許清單requireMention設定在錯誤位置(必須位於channels.discord.guilds或頻道項目底下)- 傳送者遭 guild/channel
users允許清單封鎖
長時間執行的 Discord 回合或重複回覆
長時間執行的 Discord 回合或重複回覆
Slow listener detected ...stuck session: sessionKey=agent:...:discord:... state=processing ...
- 單帳號:
channels.discord.eventQueue.listenerTimeout - 多帳號:
channels.discord.accounts.<accountId>.eventQueue.listenerTimeout - 這只控制 Discord Gateway 監聽器工作,不控制代理回合生命週期
Gateway 中繼資料查詢逾時警告
Gateway 中繼資料查詢逾時警告
/gateway/bot 中繼資料。暫時性失敗會退回 Discord 的預設 Gateway URL,並在記錄中受到速率限制。中繼資料逾時旋鈕:- 單帳號:
channels.discord.gatewayInfoTimeoutMs - 多帳號:
channels.discord.accounts.<accountId>.gatewayInfoTimeoutMs - 未設定 config 時的 env 後援:
OPENCLAW_DISCORD_GATEWAY_INFO_TIMEOUT_MS - 預設值:
30000(30 秒),最大值:120000
Gateway READY 逾時重新啟動
Gateway READY 逾時重新啟動
READY 事件。具有啟動錯開的多帳號設定,可能需要比預設值更長的啟動 READY 時窗。READY 逾時旋鈕:- 啟動單帳號:
channels.discord.gatewayReadyTimeoutMs - 啟動多帳號:
channels.discord.accounts.<accountId>.gatewayReadyTimeoutMs - 未設定 config 時的啟動 env 後援:
OPENCLAW_DISCORD_READY_TIMEOUT_MS - 啟動預設值:
15000(15 秒),最大值:120000 - runtime 單帳號:
channels.discord.gatewayRuntimeReadyTimeoutMs - runtime 多帳號:
channels.discord.accounts.<accountId>.gatewayRuntimeReadyTimeoutMs - 未設定 config 時的 runtime env 後援:
OPENCLAW_DISCORD_RUNTIME_READY_TIMEOUT_MS - runtime 預設值:
30000(30 秒),最大值:120000
權限稽核不相符
權限稽核不相符
channels status --probe 權限檢查只適用於數字頻道 ID。如果你使用 slug 鍵,runtime 比對仍可運作,但 probe 無法完整驗證權限。DM 與配對問題
DM 與配對問題
- DM 已停用:
channels.discord.dm.enabled=false - DM 政策已停用:
channels.discord.dmPolicy="disabled"(舊版:channels.discord.dm.policy) - 正在
pairing模式中等待配對核准
Bot 對 bot 迴圈
Bot 對 bot 迴圈
channels.discord.allowBots=true,請使用嚴格的提及與允許清單規則,以避免迴圈行為。
建議使用 channels.discord.allowBots="mentions",只接受提及該 bot 的 bot 訊息。語音 STT 因 DecryptionFailed(...) 掉線
語音 STT 因 DecryptionFailed(...) 掉線
- 保持 OpenClaw 為目前版本(
openclaw update),以確保存在 Discord 語音接收復原邏輯 - 確認
channels.discord.voice.daveEncryption=true(預設值) - 從
channels.discord.voice.decryptionFailureTolerance=24(上游預設值)開始,只在需要時調整 - 觀察記錄中的:
discord voice: DAVE decrypt failures detecteddiscord voice: repeated decrypt failures; attempting rejoin
- 如果自動重新加入後失敗仍持續,請收集記錄,並與 discord.js #11419 和 discord.js #11449 中的上游 DAVE 接收歷史進行比較
設定參考
主要參考:設定參考 - Discord。高訊號 Discord 欄位
高訊號 Discord 欄位
- 啟動/驗證:
enabled,token,accounts.*,allowBots - 政策:
groupPolicy,dm.*,guilds.*,guilds.*.channels.* - 指令:
commands.native,commands.useAccessGroups,configWrites,slashCommand.* - 事件佇列:
eventQueue.listenerTimeout(監聽器預算),eventQueue.maxQueueSize,eventQueue.maxConcurrency - Gateway:
gatewayInfoTimeoutMs,gatewayReadyTimeoutMs,gatewayRuntimeReadyTimeoutMs - 回覆/歷史:
replyToMode,historyLimit,dmHistoryLimit,dms.*.historyLimit - 傳遞:
textChunkLimit,chunkMode,maxLinesPerMessage - 串流:
streaming(舊版別名:streamMode),streaming.preview.toolProgress,draftChunk,blockStreaming,blockStreamingCoalesce - 媒體/重試:
mediaMaxMb(限制 Discord 對外上傳,預設100MB),retry - 動作:
actions.* - 狀態:
activity,status,activityType,activityUrl - UI:
ui.components.accentColor - 功能:
threadBindings, 頂層bindings[](type: "acp"),pluralkit,execApprovals,intents,agentComponents,heartbeat,responsePrefix
安全與作業
- 將 bot token 視為秘密(受監督環境中建議使用
DISCORD_BOT_TOKEN)。 - 授與最低權限的 Discord 權限。
- 如果指令部署/狀態過舊,請重新啟動 Gateway,並用
openclaw channels status --probe重新檢查。