# Telegram

## Telegram Push Types

1. [User (Message sent to an individual user)](#set-user)
2. [Group (Message sent to a group)](#set-group)
3. [Channel](#set-channel)[ (Message sent to a channel)](#set-channel)
4. [Bot (Create your own branded TG Bot)](#set-bot)

For push notifications of types 1 User, 2 Group, 3 Channel, messages are sent through ChainBot's official [Telegram Bot](https://t.me/chainbot_bot).

For type 4 Bot, you can configure a TG Bot branded for yourself, allowing you to spread it to more individuals, groups, and channels.

### How to Set Up User? <a href="#set-user" id="set-user"></a>

1. Choose Chat Type as User.
2. Click Get Chat ID and it will redirect you to the Telegram app.
3. After choosing "Start," you will receive a message from ChainBot that includes the Chat ID.
4. Copy the Chat ID and fill it in the ChainBot platform.

<figure><img src="https://3957434529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fytm2ftx9VGhS1jFp37FQ%2Fuploads%2Fgit-blob-5dae573e1e8a5ba6db679d317e3fbf342a527af1%2Ftelegram%20(1).png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3957434529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fytm2ftx9VGhS1jFp37FQ%2Fuploads%2Fgit-blob-7b69e5f1ac0d775dee50b9ee58fd0985e5fd359c%2Fimage%20(95).png?alt=media" alt=""><figcaption><p>Got your Chat ID</p></figcaption></figure>

<figure><img src="https://3957434529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fytm2ftx9VGhS1jFp37FQ%2Fuploads%2Fgit-blob-b2e020a6c52a6f5073c0bdfa426285d369516c9a%2Ftelegram-1.png?alt=media" alt=""><figcaption></figcaption></figure>

### How to Set Up Group? <a href="#set-group" id="set-group"></a>

1. Choose Chat Type as Group.
2. Add the ChainBot bot to the Group.
3. Groups are divided into **Private** and **Public** types, first confirm the type of Group.
4. If it's a Private Group, you need to fill in the **Chat ID with a minus sign,** e.g., -123456.
5. If it's a Public Group, you need to fill in the **Group Name with an @ symbol,** e.g., @chainbot\_group.
6. Copy the Chat ID with a minus sign or the Group Name with @ symbol and fill it in on the ChainBot platform.

#### Adding the ChainBot Bot to the Group

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

<figure><img src="https://3957434529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fytm2ftx9VGhS1jFp37FQ%2Fuploads%2Fgit-blob-7ac86c92f1252b6fdb2d5dae626c4b70251dd0b7%2Fimage%20(35).png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3957434529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fytm2ftx9VGhS1jFp37FQ%2Fuploads%2Fgit-blob-85460ba59e9e784797a94f3ea8a9eae1c88738f4%2Fimage%20(14).png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3957434529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fytm2ftx9VGhS1jFp37FQ%2Fuploads%2Fgit-blob-05b1e675182ae9ba2931aa5ab84e9f7869f6fdfd%2Fimage%20(22).png?alt=media" alt=""><figcaption></figcaption></figure>

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

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

#### Confirming the Type of Group <a href="#confirm-group-type" id="confirm-group-type"></a>

<figure><img src="https://3957434529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fytm2ftx9VGhS1jFp37FQ%2Fuploads%2Fgit-blob-818f12cbe3d3c5b1afbfb9b9737781d9b7c67a07%2Fimage%20(30).png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3957434529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fytm2ftx9VGhS1jFp37FQ%2Fuploads%2Fgit-blob-4a66baa199279fa6c0341452073b1ffa486b6273%2Fimage%20(26).png?alt=media" alt=""><figcaption></figcaption></figure>

#### Getting the Chat ID or Group Name

**You need to open Telegram on the web,** [**https://web.telegram.org/**](https://web.telegram.org/)

Get the Group Name of the Public Group from the web URL, e.g., @chainbot\_public\_group

<figure><img src="https://3957434529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fytm2ftx9VGhS1jFp37FQ%2Fuploads%2Fgit-blob-4acf0561a6fcd81a48aa5ee58d2a7947839d3ff4%2Fimage%20(13).png?alt=media" alt=""><figcaption></figcaption></figure>

Get the Chat ID of the Private Group from the web URL, e.g., -811463215

<figure><img src="https://github.com/ChainbotAI/doc-en/blob/master/.gitbook/assets/image%20(2)%20(1).png" alt=""><figcaption></figcaption></figure>

#### Fill in the Chat ID or Group Name on the ChainBot platform

<figure><img src="https://3957434529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fytm2ftx9VGhS1jFp37FQ%2Fuploads%2Fgit-blob-9d5e8ce92094572930533db98c31098d7a912b1e%2Ftelegram-2.png?alt=media" alt=""><figcaption></figcaption></figure>

### How to Set Up Channel? <a href="#set-channel" id="set-channel"></a>

1. Choose Chat Type as Channel (steps are the same as Group).
2. Add the ChainBot bot to the Channel, **and set it as an admin** (steps are the same as Group).
3. Channels are divided into Private and Public types, **messages can only be pushed to Public Channels,** first confirm the Channel type (steps are the same as Group).
4. If it's a Public Channel, you need to fill in the **Channel Name with an @ symbol,** e.g., @chainbot\_channel (steps are the same as Group).

### How to Set Up Bot <a href="#set-bot" id="set-bot"></a>

1. First, you need to create your own Telegram Bot. Refer to Telegram's [official tutorial](https://core.telegram.org/bots/features#creating-a-new-bot).
2. After creating your own Bot using [BotFather](https://t.me/BotFather), you will see the API Token for this Bot. Or, you can choose the recently created Bot again from the /mybots menu command to view this API Token.

   <figure><img src="https://3957434529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fytm2ftx9VGhS1jFp37FQ%2Fuploads%2Fgit-blob-98a4cd44ce90dfb89b7e2772d54144775f8fa9dc%2Fimage%20(2).png?alt=media" alt=""><figcaption></figcaption></figure>
3. Copy the API Token, return to ChainBot, choose "Bot" as Chat Type, and paste the API Token in the corresponding input box. Click Save.

   <figure><img src="https://3957434529-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fytm2ftx9VGhS1jFp37FQ%2Fuploads%2Fgit-blob-0505ee968d3c2d7f5be700be17cf11f8d6149743%2Fimage%20(1).png?alt=media" alt=""><figcaption></figcaption></figure>
4. After saving successfully, you can control whether your Bot pushes messages in the current chat session using the `/start` and `/stop` commands. For example, you can add this Bot to a group, and as an admin, send the `/start` command in the group. The TG Bot will then send your monitoring messages in the group.

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