> For the complete documentation index, see [llms.txt](https://docs.maiagent.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.maiagent.ai/build/choose-channel/connect-telegram.md).

# 串接對話平台：Telegram

串接 Telegram 對話平台：建立 Telegram Bot 取得 Bot Token，在 MaiAgent 新增對話平台並綁定 Agent 的步驟。

## <mark style="color:blue;">串接前確認</mark> <a href="#pre-integration-checklist" id="pre-integration-checklist"></a>

* 已在 [MaiAgent 平台](https://admin.maiagent.ai/)上建立好一個「AI 助理」
* 已註冊 Telegram 帳號

## <mark style="color:blue;">開始串接</mark> <a href="#start-integration" id="start-integration"></a>

### 1. 進入左側選單 「對話平台」，點選右上方 <mark style="color:blue;">「＋串接對話平台」</mark> 按鈕 <a href="#step-go-to-channel-menu" id="step-go-to-channel-menu"></a>

<figure><img src="https://1593648278-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmzb5NG9GDzFP2YDKeYVl%2Fuploads%2Fgit-blob-cfa83521237f42113d84ee922d67815b61bcbcc4%2F%E6%88%AA%E5%9C%96%202025-05-06%20%E4%B8%8B%E5%8D%882.29.25.png?alt=media" alt=""><figcaption></figcaption></figure>

### 2. 對話平台選擇 Telegram <a href="#step-select-telegram" id="step-select-telegram"></a>

<figure><img src="https://1593648278-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmzb5NG9GDzFP2YDKeYVl%2Fuploads%2Fgit-blob-bdcede59dc7b50838e69ec050c1a23e4c542f895%2F%E6%88%AA%E5%9C%96%202025-05-06%20%E4%B8%8B%E5%8D%882.32.08.png?alt=media" alt=""><figcaption></figcaption></figure>

### 3. 填寫對話平台名稱、選擇 Agent <a href="#step-fill-channel-name-and-ai-agent" id="step-fill-channel-name-and-ai-agent"></a>

<figure><img src="https://1593648278-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmzb5NG9GDzFP2YDKeYVl%2Fuploads%2Fgit-blob-91d5396a37d928491b1e057dfdd698873ff60173%2F%E6%88%AA%E5%9C%96%202025-05-06%20%E4%B8%8B%E5%8D%882.35.01.png?alt=media" alt=""><figcaption></figcaption></figure>

### 4. 從 BotFather <https://t.me/BotFather> 取得 Bot Token <a href="#step-get-bot-token-from-botfather" id="step-get-bot-token-from-botfather"></a>

#### a. 點選「BotFather」連結：<https://t.me/BotFather> <a href="#sub-step-open-botfather-link" id="sub-step-open-botfather-link"></a>

<figure><img src="https://1593648278-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmzb5NG9GDzFP2YDKeYVl%2Fuploads%2Fgit-blob-744702f30502faa32b469df8900384fffaf9690d%2Fimage%20(1)%20(1)%20(1)%20(1)%20(1)%20(1).png?alt=media" alt=""><figcaption></figcaption></figure>

#### b. 進入 Telegram BotFather 的頻道 <a href="#sub-step-enter-botfather-channel" id="sub-step-enter-botfather-channel"></a>

<figure><img src="https://1593648278-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmzb5NG9GDzFP2YDKeYVl%2Fuploads%2Fgit-blob-7f3c18769c6fcf3002319c8c975c114fbd9adda9%2F%E8%9E%A2%E5%B9%95%E6%93%B7%E5%8F%96%E7%95%AB%E9%9D%A2%202025-08-21%20123314.png?alt=media" alt=""><figcaption></figcaption></figure>

#### c. 點選「OPEN IN WEB」（如果是網頁版） <a href="#sub-step-open-in-web" id="sub-step-open-in-web"></a>

#### 點選後，BotFather 會要求您點選 start 開始對話： <a href="#sub-step-start-botfather-conversation" id="sub-step-start-botfather-conversation"></a>

<figure><img src="https://1593648278-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmzb5NG9GDzFP2YDKeYVl%2Fuploads%2Fgit-blob-a92d51a2771b3c7073c6430760a86894dff8dc6e%2F%E6%88%AA%E5%9C%96%202025-05-06%20%E4%B8%8B%E5%8D%882.40.13.png?alt=media" alt=""><figcaption></figcaption></figure>

#### d. 點選 「<mark style="color:blue;">/newbot</mark>」，依指示輸入 Bot 名稱與用戶名稱，即可取得 Bot Token <a href="#sub-step-create-new-bot" id="sub-step-create-new-bot"></a>

<figure><img src="https://1593648278-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmzb5NG9GDzFP2YDKeYVl%2Fuploads%2Fgit-blob-15b6f0fe4aa3d0a415c12f9e9125b51417253d6f%2F%E6%88%AA%E5%9C%96%202025-05-06%20%E4%B8%8B%E5%8D%883.22.23.png?alt=media" alt=""><figcaption></figcaption></figure>

### 5. 回到 MaiAgent 串接對話平台編輯介面，貼上剛取得的 Bot Token <a href="#step-paste-bot-token-in-maiagent" id="step-paste-bot-token-in-maiagent"></a>

建立表單有三個分頁：<mark style="color:blue;">基本設定</mark>、<mark style="color:blue;">功能設定</mark>、<mark style="color:blue;">權限設定</mark>。<mark style="color:blue;">基本設定</mark> 要填：

| 欄位                                                                            | 說明                                                                                                    |
| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| <mark style="color:blue;">名稱</mark>、<mark style="color:blue;">AI 助理</mark>    | 平台名稱與要串接的 Agent（步驟 3）                                                                                 |
| <mark style="color:blue;">Telegram 頻道</mark> › Bot Token                      | 貼上從 BotFather 取得的 Token。欄位下方提示「填寫 Bot Token 後，系統將自動為您設定 Webhook，無需額外設定」，不必像 LINE 一樣回到平台後台貼 Webhook 網址 |
| <mark style="color:blue;">聊天室設定</mark> › 群組中僅在被 @ 提及時回應                       | 開啟後，Agent 在 Telegram 群組裡只回應被 @ 提及的訊息；關閉則回應群組內所有訊息                                                     |
| <mark style="color:blue;">啟用輸入中提示</mark>                                      | Agent 處理回覆時，在 Telegram 顯示「輸入中」提示                                                                      |
| <mark style="color:blue;">啟用重置命令</mark>、<mark style="color:blue;">重置命令</mark> | 開啟後可新增一到多個指令文字；使用者傳送這些文字時，會為他另開一段新對話                                                                  |

<mark style="color:blue;">功能設定</mark>（啟用 OCR、使用系統時間回答與時區、使用傳送者名稱回答）與 <mark style="color:blue;">權限設定</mark> 兩個分頁與其他通訊平台相同，見[功能設定](/build/conversation-settings/platform-settings/function-settings.md#messaging-platform-switches)與[對話平台設定總覽](/build/conversation-settings/platform-settings.md#tab-map)。

貼上 Bot Token 後，點選右下角的「<mark style="color:blue;">串接對話平台</mark>」按鈕，即可完成串接設定

<figure><img src="https://1593648278-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmzb5NG9GDzFP2YDKeYVl%2Fuploads%2Fgit-blob-dc10a03da58822d2e9ed5b061ec10c3c3de6475a%2F%E6%88%AA%E5%9C%96%202025-05-06%20%E4%B8%8B%E5%8D%883.41.08.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1593648278-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmzb5NG9GDzFP2YDKeYVl%2Fuploads%2Fgit-blob-c54f0b7fc1d670659e126e5b0fa4000f99f62ca1%2F%E6%88%AA%E5%9C%96%202025-05-06%20%E4%B8%8B%E5%8D%882.49.41.png?alt=media" alt=""><figcaption></figcaption></figure>

### 6. **確認串接是否成功** <a href="#step-verify-integration" id="step-verify-integration"></a>

您可以至剛設定的 Telegram Bot 進行對話

<figure><img src="https://1593648278-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmzb5NG9GDzFP2YDKeYVl%2Fuploads%2Fgit-blob-b7bb328d53c255ce72012401dd26ca1edc29d942%2F%E6%88%AA%E5%9C%96%202025-05-06%20%E4%B8%8B%E5%8D%882.55.48.png?alt=media" alt=""><figcaption></figcaption></figure>

如果相關對話可在 MaiAgent 的所有對話中查看，就表示已成功串接！


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.maiagent.ai/build/choose-channel/connect-telegram.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
