> For the complete documentation index, see [llms.txt](https://docs.cherryai.com.cn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cherryai.com.cn/docs/zhong-wen-fan-ti/advanced-basic/automation/channels.md).

# 頻道

頻道會將一個 Agent 連接到外部訊息平台。現時可配置飛書、Telegram、QQ、微信、Discord 同 Slack；各平台所需嘅機器人憑據同會話標識都唔同。

{% hint style="success" %}
建議先喺【工作】入面同 Agent 講：「為而家呢個 Agent 配置飛書頻道，用嚟接收群訊息同發送任務結果。」Agent 會按用途詢問必要資訊，比起直接面對晒所有平台欄位會快啲。需要精準修改時，再用【設定】→【頻道】。
{% endhint %}

<figure><img src="/files/5e4a32c3987266b6db0fda964761c893027b814a" alt="频道设置中的飞书、Telegram、QQ、微信、Discord 和 Slack 平台入口"><figcaption><p>先揀要接入嘅平台，再撳【添加】；唔同平台要準備嘅帳號同憑據都唔同。</p></figcaption></figure>

## 手動配置路徑

【設定】→【頻道】→揀平台→【添加】。

{% stepper %}
{% step %}

### 1. 準備平台帳號

按照平台規則建立機器人或應用。飛書同微信支援掃碼相關流程時，可喺啟用頻道後按介面提示完成；其他平台填寫對應 Token 或應用憑據。
{% endstep %}

{% step %}

<figure><img src="/files/bd256b3deb633aee8b98169a36677ebe07cb0bd1" alt="飞书频道配置中的 Agent、应用凭据、允许聊天范围和权限模式"><figcaption><p>先綁定已經測試過嘅 Agent，並限制可允許嘅聊天範圍；憑據同權限只開放完成任務所需嘅部分。</p></figcaption></figure>

### 2. 綁定 Agent 同工作區

揀已經驗證可用嘅 Agent，並為頻道訊息指定工作區。外部訊息會喺呢個上下文中執行，唔好揀包含無關敏感文件嘅目錄。
{% endstep %}

{% step %}

### 3. 限制訊息來源

填寫允許嘅 Chat ID、頻道 ID 或用戶 ID。留空可能表示允許全部，具體以而家平台欄位說明為準。可以先向機器人發送 `/whoami` 攞到正確格式嘅標識。
{% endstep %}

{% step %}

### 4. 選擇權限模式並啟用

預設使用【繼承智能體設定】。公開群、多人成員群或不可信來源應使用更嚴格嘅模式。啟用後先發送冇副作用嘅測試訊息。
{% endstep %}
{% endstepper %}

## 推薦配置

| 配置項      | 產品預設值     | 建議起點            | 作用             | 適用場景       | 注意事項              |
| -------- | --------- | --------------- | -------------- | ---------- | ----------------- |
| 綁定 Agent | 需要選擇      | 為頻道另外準備一個 Agent | 決定訊息由邊個處理      | 群組聊天、機器人私聊 | 唔好同高權限開發 Agent 混用 |
| 工作區      | 需要選擇      | 使用唔包含私人資料嘅專用目錄  | 限制可處理文件        | 群內收集、日報交付  | 唔選用戶主目錄           |
| 允許嘅訊息來源  | 視乎平台欄位而定  | 先只允許測試帳號或測試群    | 限制邊個可以觸發 Agent | 內測、團隊群     | 留空之前先閱讀欄位說明       |
| 權限模式     | 【繼承智能體設定】 | 外部入口使用更嚴格嘅批准    | 控制工具操作         | 公開群、多人成員群  | 唔建議使用【完全訪問】       |

## 使用場景：團隊值班群

建立一個只處理值班手冊嘅 Agent，綁定經過召回測試嘅知識庫同專用工作區，只允許值班群觸發。先測試「查一條制度」同「搵唔到答案」兩類訊息，再測試生成唔包含敏感資訊嘅交接摘要。

### 完成標準

非允許來源唔可以觸發任務；回覆可以回到指定群；知識庫冇內容時會明確說明；檔案寫入仍然會要求批准。

## 平台配置重點

| 平台        | 主要憑據                     | 會話範圍重點             |
| --------- | ------------------------ | ------------------ |
| 飛書 / Lark | App ID、App Secret，或者掃碼流程 | 聊天 ID 同國內／國際域名     |
| Telegram  | Bot Token                | Chat ID            |
| QQ        | App ID、Client Secret     | 私聊、群組或頻道標識格式       |
| 微信        | 掃碼登入或憑據路徑                | 允許嘅用戶 ID           |
| Discord   | Bot Token                | 頻道或私聊 ID           |
| Slack     | Bot Token、App Token      | Socket Mode 同頻道 ID |

{% hint style="danger" %}
機器人 Token、App Secret 同驗證令牌等同帳號密碼。唔好寫入 Agent 長期記憶、任務提示詞、截圖或者公開 Issue；洩露之後應立即喺平台端撤銷並重新生成。
{% endhint %}

<details>

<summary>定時任務揀唔到頻道接收目標點算？</summary>

先喺對應平台主動畀機器人發送一條訊息，等 Cherry Studio 記錄可用嘅 Chat ID，再返去定時任務揀通知目標。

</details>

<details>

<summary>頻道已連接但冇回覆點算？</summary>

檢查允許嘅會話 ID、綁定 Agent、工作區同權限模式，再查看頻道日誌。平台收到咗訊息但 Agent 未執行時，繼續檢查 API 閘道同 Agent 任務狀態。

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.cherryai.com.cn/docs/zhong-wen-fan-ti/advanced-basic/automation/channels.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
