> For the complete documentation index, see [llms.txt](https://docs.noqo.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.noqo.ai/channels/messengers/telegram.md). Agents can also search and read this documentation through its [MCP server](https://docs.noqo.ai/~gitbook/mcp).

# Telegram

Telegram is a free online messenger, one of the most popular mobile applications in the world.

## What does it allow?

This channel allows you to fully automate communication with customers.

## Connection

### Connecting Noqo to a bot in Telegram

1. To connect Telegram to your bot in Noqo, go to the **"Messengers"** tab in the **"Channels"** section and select Telegram.

<figure><img src="https://1782981877-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKvUDH16L29QcaH0CuUhn%2Fuploads%2FdmcMJoZ65q7fBDJnnCXp%2FPasted%20image%2020251109193925.png?alt=media&amp;token=cb256e22-b3c8-458d-8096-015eb2ab9ec1" alt=""><figcaption></figcaption></figure>

2. We see a field where we need to enter a token. A token is a unique user identifier in Telegram. It allows servers to identify requests; it encrypts access to the channel bot so that fraudsters do not obtain it.

<figure><img src="https://1782981877-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKvUDH16L29QcaH0CuUhn%2Fuploads%2FCbiNUNNVLZdOsM9w6DNg%2FPasted%20image%2020251109194238.png?alt=media&amp;token=0f6915f9-8b68-4015-8dbf-09996c2637a7" alt=""><figcaption></figcaption></figure>

4. To get the token, you need to type **@BotFather** in the Telegram search bar.
5. To create a new bot, enter the command **/newbot** and follow the instructions. Once completed, you will receive information about your bot, including its link and access token. Copy the access token.

<figure><img src="https://1782981877-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKvUDH16L29QcaH0CuUhn%2Fuploads%2FDUC7aOWWD4vgj3PkDuRb%2FPasted%20image%2020251109194900.png?alt=media&amp;token=aeef9809-c872-489e-b188-e186c7d48f00" alt=""><figcaption></figcaption></figure>

6. After you have received the token in **@BotFather**, enter it in the Telegram field and click **"Connect."**

<figure><img src="https://1782981877-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKvUDH16L29QcaH0CuUhn%2Fuploads%2FGfDV11pqcnizTQ9JW5Ry%2FPasted%20image%2020251109195259.png?alt=media&amp;token=86fa1570-437e-4673-8a72-9934de6f7437" alt=""><figcaption></figcaption></figure>

7. Next, the following settings will appear:

<figure><img src="https://1782981877-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKvUDH16L29QcaH0CuUhn%2Fuploads%2FxHDaL8Nv3y7QqwqDcIhO%2FPasted%20image%2020251109195544.png?alt=media&amp;token=696ac14d-657a-4c5e-900d-de4886b1f433" alt=""><figcaption></figcaption></figure>

If we set a Greeting message in the Message field for the /start command, the bot will always write it when a client contacts the Telegram bot, which is already connected to Noqo:

<figure><img src="https://1782981877-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKvUDH16L29QcaH0CuUhn%2Fuploads%2FOwXeRfQXqxyWUW3UN9cj%2FPasted%20image%2020251109195630.png?alt=media&amp;token=63c7bde4-a548-4876-9596-829f81c16315" alt=""><figcaption></figcaption></figure>

Clearing the context with the **/start** command.

<figure><img src="https://1782981877-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKvUDH16L29QcaH0CuUhn%2Fuploads%2FqNSm9MJznmC23WGA6nVy%2Fimage.png?alt=media&amp;token=4c019d73-b7c2-4f16-9426-7ffbf8c1d32d" alt=""><figcaption></figcaption></figure>

This setting is especially useful for test conversations. When you send the **/start** command to the Telegram bot, the chat context is completely cleared, allowing you to start a new conversation.

Read receipts for business bots

<figure><img src="https://1782981877-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKvUDH16L29QcaH0CuUhn%2Fuploads%2FjrPjk9Ir3DLSWrCc8bSJ%2Fimage.png?alt=media&amp;token=687c76b6-b2ee-4306-99f9-54d6cfed6c56" alt=""><figcaption></figcaption></figure>

If you want messages in a business bot to be marked as read, grant the **“Read messages”** permission in the business bot settings.\
Then, in Noqo settings, enable **“Read receipts for business bots.”**

### How to find the User ID, Bot ID, Group ID, and Channel ID

An ID is a unique number used to identify users, bots, groups, or channels in Telegram. It is different from a **@username**, which can be changed at any time.

To find your **User ID**, **Bot ID**, **Group ID**, or **Channel ID**, follow these steps:

1. Go to your Telegram channel settings. Enable the **“Handles /get\_id command”** option.

<figure><img src="https://1782981877-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKvUDH16L29QcaH0CuUhn%2Fuploads%2FF2a2mzxEVS3DSCqtY264%2FPasted%20image%2020251109203747.png?alt=media&amp;token=68bd6c30-edde-46c8-8680-e828b9530c08" alt=""><figcaption></figcaption></figure>

2. In the chat with the bot, send the **/get\_id** command. After executing the command, buttons will appear that allow you to retrieve the corresponding IDs.

<figure><img src="https://1782981877-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKvUDH16L29QcaH0CuUhn%2Fuploads%2Ff68qcPgpQwKyRv1GuJ85%2FPasted%20image%2020251109203818.png?alt=media&amp;token=a7e98ef0-236b-4de2-ae59-415517be3a4d" alt=""><figcaption></figcaption></figure>

**MY ID** — allows you to get your own ID.\
**USER ID** — allows you to get another user’s ID.\
**BOT ID** — allows you to get a bot’s ID.\
**GROUP ID** — allows you to get a group’s ID.\
**CHANNEL ID** — allows you to get a channel’s ID.

Select the desired button. If you choose **MY ID**, your ID will immediately appear in the chat.\
For other options, tap the corresponding button, select the user, bot, group, or channel you’re interested in, and the related ID will then appear in the chat.

### Configuring the blacklist and whitelist of users by their IDs

Here you can enter the IDs of users whom the bot **will not respond to**, or the IDs of users whom the bot **will respond to** (in this case, the bot will reply **only to the selected users**).

<figure><img src="https://1782981877-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKvUDH16L29QcaH0CuUhn%2Fuploads%2FCSg0elbhd3mhaaxIzo61%2FPasted%20image%2020251109205249.png?alt=media&amp;token=2a6b3726-fe6d-43c5-82e6-1054db7238d1" alt=""><figcaption></figcaption></figure>

### Bot reply mode in groups

To enable the bot to respond in groups, activate the **“Responses in group”** flag.

<figure><img src="https://1782981877-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKvUDH16L29QcaH0CuUhn%2Fuploads%2FtTYuSUk57vp8kU1iunGO%2FPasted%20image%2020251109205432.png?alt=media&amp;token=56f7f43a-5889-4f58-9b76-78eef8b43e55" alt=""><figcaption></figcaption></figure>

* If the **“Respond only to messages where it is called”** flag is **disabled**, the bot will respond to all messages in the group it is connected to.
* If the **“Respond only to messages where it is called”** flag is **enabled**, the bot will respond **only when it is mentioned**, for example: **@noqo\_bot** Hello!

In the **“Keywords for responding to a message”** field, you can specify keywords that will trigger the bot’s response when used in a conversation.

### Checking channel subscriptions

Enabling the **“Check subscription to group”** flag allows the bot to respond **only to subscribed users**. Users who are not subscribed will see a predefined message.

<figure><img src="https://1782981877-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKvUDH16L29QcaH0CuUhn%2Fuploads%2Fbj0azBzDbzqKQL3cXJGp%2FPasted%20image%2020251109205546.png?alt=media&amp;token=fc4edb5c-d732-4f65-96a6-f8637d963b8f" alt=""><figcaption></figcaption></figure>

### Bot reply mode in groups with topics

Configuring the bot’s replies, the bot's repies when mentioned, when using keywords, and checking subscriptions works the same way as described in the previous section.

Additionally, you can specify **topic IDs** where the bot **should** respond and topics where it **should not** respond. Instructions on how to find a topic ID are provided below in the corresponding section.

### Bot reply mode in channels

Configuring the bot’s replies in channels works the same way as configuring replies in groups.

### Connecting Noqo to an individual account

If you have Telegram Business, you can connect Noqo to an individual Telegram account. For this, there is a designated User ID field.

{% hint style="info" %}
On March 31, 2024, Telegram released a useful update — the ability to link a chatbot to a business account and conduct bot communication with clients not only in bot mode but also when users message the familiar Telegram account.
{% endhint %}

NOTE: Telegram Premium is needed for this.

1. You need to send the **/start** command to the bot [@PremiumBot](https://t.me/PremiumBot).
2. Next, payment is required for the duration you want to keep Premium.
3. After payment, go to **@BotFather**, click **/mybots**, and select the desired bot.

<figure><img src="https://1782981877-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKvUDH16L29QcaH0CuUhn%2Fuploads%2FvJSc5fbW3buAP8bpqGg8%2FPasted%20image%2020251109200025.png?alt=media&amp;token=c36f8279-9b5c-4bdf-a663-899170e36898" alt=""><figcaption></figcaption></figure>

4. Then select **Bot Settings**.

<figure><img src="https://1782981877-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKvUDH16L29QcaH0CuUhn%2Fuploads%2Fp8GLFzrqpUvELVHD5qHn%2FPasted%20image%2020251109200242.png?alt=media&amp;token=3048b055-3703-4520-a191-f288b470d802" alt=""><figcaption></figcaption></figure>

5. Click on **Business Mode**.

<figure><img src="https://1782981877-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKvUDH16L29QcaH0CuUhn%2Fuploads%2FbDAGueMrIVrKh5bLeo5G%2FPasted%20image%2020251109200531.png?alt=media&amp;token=9d0c2206-f032-4b16-aea8-a46f30583cb3" alt=""><figcaption></figcaption></figure>

6. Then select **Turn on**.

<figure><img src="https://1782981877-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKvUDH16L29QcaH0CuUhn%2Fuploads%2Fx128D8KmJDxgod7bJn0L%2FPasted%20image%2020251109200631.png?alt=media&amp;token=7033a1e4-8a34-47f6-8314-b49b12168411" alt=""><figcaption></figcaption></figure>

### Connecting Telegram Business

1. Go to **Settings**.

<figure><img src="https://1782981877-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKvUDH16L29QcaH0CuUhn%2Fuploads%2FyLC9m4JE9D5RIave0fuJ%2FPasted%20image%2020251109200843.png?alt=media&amp;token=4609925f-ac29-4195-9cdc-b53a6e25e08c" alt=""><figcaption></figcaption></figure>

2. Find **Telegram Business**.

<figure><img src="https://1782981877-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKvUDH16L29QcaH0CuUhn%2Fuploads%2FDxHw75kt7X90xhFp9D7P%2FPasted%20image%2020251109201416.png?alt=media&amp;token=3343c12e-6e85-4983-b29e-636f9d3b172e" alt=""><figcaption></figcaption></figure>

4. Next, go to the **Chat Bots** section.

<figure><img src="https://1782981877-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKvUDH16L29QcaH0CuUhn%2Fuploads%2FVFDLB1o4O6JOOkgXXE66%2FPasted%20image%2020251109201749.png?alt=media&amp;token=f1799b5b-6556-4244-889b-33eae3f72409" alt=""><figcaption></figcaption></figure>

5. Enter our bot's username or URL in the field.

<figure><img src="https://1782981877-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKvUDH16L29QcaH0CuUhn%2Fuploads%2FYJxeRigNRzU0rIqHKG7W%2FPasted%20image%2020251109201904.png?alt=media&amp;token=8c982dbe-0f58-45b4-8dd1-88e955fb2c7e" alt=""><figcaption></figcaption></figure>

6. Then choose where your bot will respond.

<figure><img src="https://1782981877-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKvUDH16L29QcaH0CuUhn%2Fuploads%2FfghBEpKNMD0IyReqAWoM%2FPasted%20image%2020251109202422.png?alt=media&amp;token=ac05edab-7b90-4a4a-a5c3-4bd451dac9c3" alt=""><figcaption></figcaption></figure>

7. Then grant your bot the necessary permissions.

<figure><img src="https://1782981877-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKvUDH16L29QcaH0CuUhn%2Fuploads%2FM22aVc1GdG9lta1K2Rp2%2FPasted%20image%2020251109203001.png?alt=media&amp;token=e989f2f8-45e9-4910-aa1d-b24352dc8199" alt=""><figcaption></figcaption></figure>

## Disabling bot responses

If, for some reason, you temporarily need to disable bot responses in Telegram, mark the **"Bot answers"** setting as **"Disabled."**

<figure><img src="https://1782981877-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKvUDH16L29QcaH0CuUhn%2Fuploads%2FKKGDjOBUZBI20XkMOLkU%2FPasted%20image%2020251109205750.png?alt=media&amp;token=3be9f9dc-22da-48d3-9a37-f67c4ab0cbf0" alt=""><figcaption></figcaption></figure>
