OpenClaw 整合 Nextcloud Talk:5 分鐘完成設定指南
想要在自託管的環境裡搞定機器人自動化,最煩人的通常不是寫程式,而是怎麼把不同的通訊工具串接起來。如果你正在用 Nextcloud Talk,這篇指南會幫你快速把 OpenClaw 裝上去,讓你的私有雲也能動起來。
Nextcloud Talk (plugin)
Section titled “Nextcloud Talk (plugin)”Status: supported via plugin (webhook bot). Direct messages, rooms, reactions, and markdown messages are supported.
需要安裝 Plugin
Section titled “需要安裝 Plugin”Nextcloud Talk 是以 plugin 形式提供的,並沒有直接包在核心安裝程式裡。
透過 CLI 安裝 (npm registry):
openclaw plugins install @openclaw/nextcloud-talk本地安裝(如果你是從 git repo 執行):
openclaw plugins install ./path/to/local/nextcloud-talk-plugin如果在設定過程中選擇 Nextcloud Talk 且系統偵測到 git checkout,OpenClaw 會自動提供本地安裝路徑。
詳細資訊:Plugins
快速設定(新手入門)
Section titled “快速設定(新手入門)”-
安裝 Nextcloud Talk plugin。
-
在你的 Nextcloud 伺服器上,建立一個 bot:
Terminal window ./occ talk:bot:install "OpenClaw" "<shared-secret>" "<webhook-url>" --feature reaction -
在目標聊天室的設定裡啟用 bot。
-
設定 OpenClaw:
- Config:
channels.nextcloud-talk.baseUrl+channels.nextcloud-talk.botSecret - 或 env:
NEXTCLOUD_TALK_BOT_SECRET(僅限預設帳號)
- Config:
-
重啟 Gateway(或完成安裝流程)。
最簡設定:
{ channels: { "nextcloud-talk": { enabled: true, baseUrl: "https://cloud.example.com", botSecret: "shared-secret", dmPolicy: "pairing", }, },}- Bot 沒辦法主動發起 DM,使用者必須先傳訊息給 bot。
- Webhook URL 必須是 Gateway 碰得到的;如果躲在 proxy 後面,記得設定
webhookPublicUrl。 - Bot API 不支援媒體上傳;媒體會以 URL 形式傳送。
- Webhook 的資料內容分不出 DM 還是聊天室;設定
apiUser+apiPassword來啟用聊天室類型查詢(否則 DM 會被當成聊天室處理)。
存取控制 (DMs)
Section titled “存取控制 (DMs)”- 預設值:
channels.nextcloud-talk.dmPolicy = "pairing"。不認識的傳送者會拿到一組配對碼。 - 透過以下方式核准:
openclaw pairing list nextcloud-talkopenclaw pairing approve nextcloud-talk <CODE>
- 公開 DM:
channels.nextcloud-talk.dmPolicy="open"加上channels.nextcloud-talk.allowFrom=["*"]。 allowFrom只比對 Nextcloud 的使用者 ID;會忽略顯示名稱。
聊天室(群組)
Section titled “聊天室(群組)”- 預設值:
channels.nextcloud-talk.groupPolicy = "allowlist"(需透過提及/mention 觸發)。 - 使用
channels.nextcloud-talk.rooms來設定允許的聊天室:
{ channels: { "nextcloud-talk": { rooms: { "room-token": { requireMention: true }, }, }, },}- 如果不想開放任何聊天室,請保持 allowlist 為空,或設定
channels.nextcloud-talk.groupPolicy="disabled"。
| Feature | Status |
|---|---|
| Direct messages | Supported |
| Rooms | Supported |
| Threads | Not supported |
| Media | URL-only |
| Reactions | Supported |
| Native commands | Not supported |
設定參考 (Nextcloud Talk)
Section titled “設定參考 (Nextcloud Talk)”完整設定文件:Configuration
Provider 選項:
channels.nextcloud-talk.enabled: 啟用或停用頻道。channels.nextcloud-talk.baseUrl: Nextcloud 實例的 URL。channels.nextcloud-talk.botSecret: Bot 的共享金鑰。channels.nextcloud-talk.botSecretFile: 共享金鑰的檔案路徑,不支援符號連結 (symlinks)。channels.nextcloud-talk.apiUser: 用於查詢聊天室的 API 使用者(用於偵測 DM)。channels.nextcloud-talk.apiPassword: 用於查詢聊天室的 API/應用程式密碼。channels.nextcloud-talk.apiPasswordFile: API 密碼的檔案路徑。channels.nextcloud-talk.webhookPort: Webhook 監聽埠(預設:8788)。channels.nextcloud-talk.webhookHost: Webhook 主機位址(預設:0.0.0.0)。channels.nextcloud-talk.webhookPath: Webhook 路徑(預設:/nextcloud-talk-webhook)。channels.nextcloud-talk.webhookPublicUrl: 外部可存取的 Webhook URL。channels.nextcloud-talk.dmPolicy: 可設定為pairing | allowlist | open | disabled。channels.nextcloud-talk.allowFrom: DM 允許清單(使用者 ID)。設定為open時需要包含"*"。channels.nextcloud-talk.groupPolicy: 可設定為allowlist | open | disabled。channels.nextcloud-talk.groupAllowFrom: 群組允許清單(使用者 ID)。channels.nextcloud-talk.rooms: 個別聊天室的設定與允許清單。channels.nextcloud-talk.historyLimit: 群組歷史紀錄限制(0 代表停用)。channels.nextcloud-talk.dmHistoryLimit: DM 歷史紀錄限制(0 代表停用)。channels.nextcloud-talk.dms: 個別 DM 的覆寫設定(如 historyLimit)。channels.nextcloud-talk.textChunkLimit: 出站訊息的分段大小(字元數)。channels.nextcloud-talk.chunkMode:length(預設)或newline(在長度分段前先按空行/段落切分)。channels.nextcloud-talk.blockStreaming: 停用此頻道的區塊串流 (block streaming)。channels.nextcloud-talk.blockStreamingCoalesce: 區塊串流合併微調。channels.nextcloud-talk.mediaMaxMb: 入站媒體的大小上限 (MB)。
- Channels Overview — 所有支援的頻道
- Pairing — DM 認證與配對流程
- Groups — 群組對話行為與提及觸發
- Channel Routing — 訊息的對話路由
- Security — 存取模型與安全性強化
- 看看 Channels Overview 了解其他串接方式
- 參考 Security 確保你的 Gateway 設定安全
OpenClaw Expert
還是卡住了?
如果這篇文件沒有解決你的情境,直接問 OpenClaw Expert,拿到可執行步驟。