> For the complete documentation index, see [llms.txt](https://docs.chainbot.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.chainbot.io/zh/basic-usage/notify-channels/telegram.md).

# Telegram

## Telegram 推送类型

1. [User（消息发送给个人用户）](#ru-he-she-zhi-user)
2. [Group（消息发送给群组）](#ru-he-she-zhi-group)
3. [Channel](#ru-he-she-zhi-channel-qu-dao)[（消息发送给频道）](#ru-he-she-zhi-channel)
4. [Bot（创建自己品牌的 TG Bot）](#ru-he-she-zhi-bot)

对于 1 User、2 Group、3 Channel 类型的推送消息都由 ChainBot 的官方 [Telegram Bot](https://t.me/chainbot_bot) 推送。

对于4 Bot，您可以配置属于自己品牌的 TG Bot，以便将自己的 Bot 传播出去给更多的个人、群组和频道使用。

### 如何设置 User？ <a href="#set-user" id="set-user"></a>

1. 选择Chat Type为User。
2. 点击Get Chat ID跳转到 Telegram 的软件。
3. 选择 "Start" 后，将会收到一条 ChainBot 发送的一条消息，消息内容中包含 Chat ID。
4. 复制 Chat ID 填写到 ChainBot 平台即可。

<figure><img src="/files/BYSatwBfFlEbvnwmgnfY" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/6GeFin0Y0fnsJZMiTBh1" alt=""><figcaption><p>Got your Chat ID</p></figcaption></figure>

<figure><img src="/files/ZQzwqu9RA6HHTMOLHZr3" alt=""><figcaption></figcaption></figure>

### 如何设置 Group？ <a href="#set-group" id="set-group"></a>

1. 选择Chat Type为Group。
2. 将Chainbot机器人拉入到Group。
3. Group分为\*\*Private(私有)和Public(公开)\*\*两类, 首先确认Group的类型。
4. 如果是Private(私有) Group, 需要填写**带负号的Chat ID,** 如 -123456。
5. 如果是Public(公开) Group, 需要填写带\*\*@符号的Group Name,\*\* 如 @chainbot\_group。
6. 复制带负号的Chat ID 或带@符号的Group Name, 填写到 ChainBot 平台即可。

#### 将Chainbot机器人拉入到Group

<figure><img src="/files/iWuCnGPewcNbULTXvg3u" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/L4THdO6Fk8Wlc7WugeZy" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/1IJaPmJhGefZyFlrWLEA" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/7RtIaXcUJ0mrsLLvD2dD" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/XDk3oqBXvWbgNBxayHfb" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/STVdSGV44vFh3NSMVIz2" alt=""><figcaption></figcaption></figure>

#### 确认Group的类型 <a href="#confirm-group-type" id="confirm-group-type"></a>

<figure><img src="/files/qH3Y1RG0L41IhccG4P6E" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/8jlH4K7bLfsiAVnD5C7e" alt=""><figcaption></figcaption></figure>

#### 获取Chat ID或Group Name

**需要在Web端打开Telegram,** [**https://web.telegram.org/**](https://web.telegram.org/)

从网页URL上获取Public Group的Group Name, 如 @chainbot\_public\_group

<figure><img src="/files/TvYB4Y11haic88E1jsBf" alt=""><figcaption></figcaption></figure>

从网页URL上获取Private Group的Chat ID, 如 -811463215

<figure><img src="/files/lrnfCw0r81wgtMNjqxor" alt=""><figcaption></figcaption></figure>

#### 在Chainbot平台, 填写Chat ID或Group Name

<figure><img src="/files/knMkoQaEt0xhrSER3iDT" alt=""><figcaption></figcaption></figure>

### 如何设置 Channel？ <a href="#set-channel" id="set-channel"></a>

1. 选择Chat Type为Channel (操作步骤与Group一致)。
2. 将Chainbot机器人拉入到Channel, **并设置为管理员** (操作步骤与Group一致)。
3. Channel分为Private(私有)和Public(公开)两类, **只能推送到Public类型的Channel,** 首先确认Channel的类型 (操作步骤与Group一致)
4. 如果是Public(公开) Channel, 需要填写带\*\*@符号的Channel Name,\*\* 如 @chainbot\_channel。(操作步骤与Group一致)

### 如何设置 Bot <a href="#set-bot" id="set-bot"></a>

1. 首先您需要创建一个自己的 Telegram Bot ，参考Telegram的[官方教程](https://core.telegram.org/bots/features#creating-a-new-bot)。

2. 使用 [BotFather](https://t.me/BotFather) 创建好属于自己的Bot后，您将看到这个 Bot 的 API Token。或者您可以在 /mybots 命令的菜单中再次选择刚刚创建的Bot查看此 API Token。

   <figure><img src="/files/rX5ahEpDgcGrelADdtqe" alt=""><figcaption></figcaption></figure>

3. 点击复制这一段 API Token，回到ChainBot，Chat Type 选择"Bot"，并将API Token粘贴在对应的输入框内。点击保存<br>

   <figure><img src="/files/S9FEWSJhWyxXAEKa2V70" alt=""><figcaption></figcaption></figure>

4. 保存成功后，您可以通过`/start` 和`/stop` 命令来控制您的Bot是否在所在聊天会话中推送消息。例如您可以将这个Bot拉入群组，并作为管理员身份在群组中发送 `/start` 命令，则该TG Bot将会在群里发送您的监控消息。

   <figure><img src="/files/KZSVsGaPMUU7c9VPGIRN" alt=""><figcaption></figcaption></figure>
