# Chatbot for a Telegram Business account

You can now create **personal business assistants** — special bots that integrate directly into individual Telegram chats. These bots automatically process incoming requests and respond on the account owner's behalf, dramatically reducing time spent on routine tasks and improving communication efficiency.

**Use cases:**\
These assistants can be configured for various purposes, such as:

* Providing product or service consultations.
* Answering frequently asked questions.
* Performing a wide range of other automated tasks.

**Key feature: seamless control**

A user can **instantly switch back to manual communication** at any time without interrupting or disabling the bot's operation, ensuring complete control over the chat.

{% hint style="warning" %}
Attention!&#x20;

Telegram Business account has a 24-hour window.

Once a user sends their first message, the bot has a **24-hour window** to respond and continue the conversation. This window is reset each time the user replies.

* **If the user replies:** The 24-hour window restarts, allowing continuous dialogue.
* **If the user does NOT reply within 24 hours:** The window closes. The bot will be blocked from sending further messages until the user sends a new message to re-initiate contact.
  {% endhint %}

## Connecting the bot

Step 1. Setup in the **Messengers** section.

1. &#x20;**If you are connecting a Telegram bot for the first time.**

FIrst, go to the Channels tab in the Mavibot section to connect Telegram chatbot (if there is not one yet).

<div data-with-frame="true"><figure><img src="/files/RGVDHKAxTEeIrdn4yq43" alt="" width="563"><figcaption></figcaption></figure></div>

Next, we connect the Telegram bot according to the[ instructions](/chatbot/messengers/telegram/chatbot.md) .&#x20;

2. **If Telegram is connected**.&#x20;

In case you already have a connected Telegram bot, find this bot in the channels:

<div data-with-frame="true"><figure><img src="/files/e7m9mVp90NsaOHATkPnf" alt="" width="563"><figcaption></figcaption></figure></div>

Next, click on the settings button, after which you will see a modal window with token fields, etc.:

<div data-with-frame="true"><figure><img src="/files/4s6m3K1aZx2g2sNB6oN4" alt="" width="563"><figcaption></figcaption></figure></div>

In the modal window that opens, click DONE to update your Telegram bot settings (you don't need to change any more settings):

<div data-with-frame="true"><figure><img src="/files/ow62XYbAKklMrtZTCEUh" alt="" width="563"><figcaption></figcaption></figure></div>

At this stage, the work with the channels is completed. Go to the messenger settings.&#x20;

Step 2. Messenger settings.

To connect Telegram chatbot to your business account, go to your profile settings, where you need to find "Telegram Business" tab:

<div data-with-frame="true"><figure><img src="/files/RjPkz8pjV1RfJFj5qHZ1" alt="" width="375"><figcaption></figcaption></figure></div>

Next, you will see "Chatbots" tab, where you need to go:

<div data-with-frame="true"><figure><img src="/files/ZdGOXPqGyCBdbON5q6F5" alt="" width="375"><figcaption></figcaption></figure></div>

Then, in the newly opened tab, enter the link to the required Telegram bot or its username (entering the link is preferred).

<div data-with-frame="true"><figure><img src="/files/MayHhvwasih66tXXzpfm" alt="" width="375"><figcaption></figcaption></figure></div>

In the same tab, set the permission ( "Reply to messages" checkbox) for the chatbot to reply to messages.

At this stage, the chatbot setup in the business account is completed. Go ahead.

Step 3. BotFather Settings.

After linking the chatbot to the business account, you need to update the chatbot's settings in BotFather, where you initially created the Telegram bot.

To do this, open the chat with BotFather and enable it to work with the business account:

<div data-with-frame="true"><figure><img src="/files/ssDlVKvMid3TCXtLBOsl" alt="" width="375"><figcaption></figcaption></figure></div>

Go to the bot settings:

<div data-with-frame="true"><figure><img src="/files/ys1jtW8kspRxu0WNSaMj" alt="" width="375"><figcaption></figcaption></figure></div>

Next, click on the "Business Mode" button to enable the business mode for the chatbot:

<div data-with-frame="true"><figure><img src="/files/oWKZulZZD6YFUx6M855o" alt="" width="375"><figcaption></figcaption></figure></div>

{% hint style="success" %}
Ready! All necessary chatbot settings with a business account have been completed.
{% endhint %}

Now, in the channel settings, you will find Telegram bot and see business ID and also the name of the business account owner:

<div data-with-frame="true"><figure><img src="/files/wmkSNYxaUCi67NWtSPE0" alt=""><figcaption></figcaption></figure></div>

### How to disable&#x20;

To disable the chatbot with business mode, go to channels and find the chatbot in which you want to disable this setting. Click on the settings button:

<div data-with-frame="true"><figure><img src="/files/a7IUbnK3zra2BMNNjEGr" alt=""><figcaption></figcaption></figure></div>

Click the "Disable Business Account" button.

<div data-with-frame="true"><figure><img src="/files/LU7x85detNAi41Gyw2uJ" alt="" width="375"><figcaption></figcaption></figure></div>

{% hint style="success" %}
If you disable your business account, chatbot will continue to work in standard mode.
{% endhint %}

## Avaliable functions

1. (API) Function in calculator:

**tg\_callback(platform\_id , callback\_message,group\_id, tg\_business)**

<details>

<summary><strong>tg_callback</strong></summary>

Parameters:

**! platform\_id** -  Telegram client ID

**! callback\_message** - callback message&#x20;

**group\_id** - Telegram bot ID

**tg\_business -** for working with business clients, takes the value "1".

</details>

**tg\_send\_poll(platform\_id, question, options, is\_anonymous, allows\_multiple\_answers, reply\_markup, disable\_notification, protect\_content, token, reply\_to\_message\_id, message\_thread\_id, business\_connection\_id)**

<details>

<summary><strong>tg_send_poll</strong></summary>

Parameters:&#x20;

**! platform\_id** - chat identifier within Telegram [**\***](/chatbot/messengers/telegram/api.md)

**! question** - question

**! options** - array of answer options

**is\_anonymous** - 1 - anonymous poll, '' - non-anonymous

**allows\_multiple\_answers** - 1 - multiple answers allowed, '' - single answer only

**reply\_markup** - keyboard, or '' - no keyboard

**disable\_notification** — flag for sending with sound notification (default 0); 1 - send silently, 0 - send with notification

**protect\_content** - 1 - protect from copying and screenshots, '' - no protection

**token** - bot token; if not provided, the current one is used

**reply\_to\_message\_id** -ID of the quoted message

**message\_thread\_id** — thread identifier (available in supergroups with forum functionality)

**business\_connection\_id -**&#x76;alue used when connecting a bot (Business ID, displayed in channels); should be passed if the bot token is provided and the message must be sent via the user account linked to the bot

</details>

**tg\_send\_quiz\_poll(platform\_id, question, options, explanation, correct\_option\_id, is\_anonymous, reply\_markup, parse\_mode, protect\_content, disable\_notification, token, reply\_to\_message\_id, message\_thread\_id )**

<details>

<summary><strong>tg_send_quiz_poll</strong></summary>

**! platform\_id** - chat identifier within Telegram [**\***](/chatbot/messengers/telegram/api.md)

**! question** - question

**! options** - array of answer options

**! explanation** - text shown when the user selects an incorrect answer or taps the light bulb icon in a quiz-style poll; 0–200 characters, with no more than two line breaks after entity parsing.

**! correct\_option\_id** - number of the correct answer, starting from 1.

**is\_anonymous** -1 - anonymous poll, '' - non-anonymous

**reply\_markup** -  keyboard, or '' - no keyboard

**parse\_mode** - markdown or html for *explanation*, or '' for no formatting.

**protect\_content** - 1  protect from copying and screenshots, '' - no protection.

**disable\_notification** —  flag for sending with sound notification (default 0); 1 - send silently, 0 - send with notification

**token** -bot token; if not provided, the current one is used.

**reply\_to\_message\_id** - ID of the quoted message

**message\_thread\_id** —thread identifier (available in supergroups with forum functionality)

**open\_period** - time allowed for completing the quiz/test; numeric value from 5 to 600, representing seconds.

**business\_connection\_id -** value used when connecting a bot (Business ID, displayed in channels); should be passed if the bot token is provided and the message must be sent via the user account linked to the bot

</details>

**tg\_send\_message\_1(token, platform\_id, text, client\_message\_id, reply\_markup, parse\_mode, disable\_web\_page\_preview, protect\_content, disable\_notification, message\_thread\_id, entities, business\_connection\_id)**

<details>

<summary><strong>tg_send_message_1</strong></summary>

Parameters:

**! token** —  Telegram bot token obtained from BotFather

**! platform\_id** — identifier of the Telegram client to which the message should be sent [**\***](/chatbot/messengers/telegram/api.md)

**! text** - message text

**client\_message\_id** - ID of the quoted message

**reply\_markup** — button settings [**\*\***](/chatbot/messengers/telegram/api.md)

**parse\_mode** — text formatting mode for bold or italic in the message description [**\*\*\***](/chatbot/builder/telegram_messages.md)**.** possible values: html, markdown, markdownV2

**disable\_web\_page\_preview -** whether to display a link preview; set to 1 to disable, otherwise 0 or leave empty ("")

**protect\_content** — flag for protecting content from copying; to enable, pass any value other than 0, False, or empty quotes ('')

**disable\_notification** —  flag for sending with sound notification (default 0); 1 - send silently, 0 - send with notification

**message\_thread\_id** — thread identifier (available in supergroups with forum functionality) **entities** — allows copying preformatted text with all styling; specify character ranges for each formatting style. You can find an example in the tg\_request field. The parameter must contain a dictionary.

**business\_connection\_id -** value used when connecting a bot (Business ID, displayed in channels); should be passed if the bot token is provided and the message must be sent via the user account linked to the bot

Example of parameter passing:

`entities = [{"offset":0,"length":5,"type":"bold"},{"offset":6,"length":4,"type":"text_link","url":"https://salebot.zmservice.ru"},{"offset":11,"length":9,"type":"strikethrough"},{"offset":21,"length":6,"type":"spoiler"},{"offset":29,"length":12,"type":"code"}]`&#x20;

In the example, only the dictionary is shown, while the message text itself is defined in a separate variable.

</details>

2. Methods

\- [tg\_send\_chat\_action](https://docs.salebot.pro/messendzhery-i-chaty/kak-sozdat-bota-v-telegram/api-telegram-funkcii-dlya-ispolzovaniya-vsekh-vozmozhnostei-telegram/funkcii-raboty-v-chatakh-i-kanalakh-telegram#tg_send_chat_action)

\- [tg\_send\_message](https://docs.salebot.pro/messendzhery-i-chaty/kak-sozdat-bota-v-telegram/api-telegram-funkcii-dlya-ispolzovaniya-vsekh-vozmozhnostei-telegram/funkcii-dlya-otpravki-i-redaktirovaniya-soobshenii)

\- [tg\_send\_poll](https://docs.salebot.pro/messendzhery-i-chaty/kak-sozdat-bota-v-telegram/api-telegram-funkcii-dlya-ispolzovaniya-vsekh-vozmozhnostei-telegram#kak-sozdat-zakryt-opros-v-chate-kanale-telegram)

\- [tg\_send\_quiz\_poll](https://docs.salebot.pro/messendzhery-i-chaty/kak-sozdat-bota-v-telegram/api-telegram-funkcii-dlya-ispolzovaniya-vsekh-vozmozhnostei-telegram#kak-sozdat-zakryt-opros-v-chate-kanale-telegram)

\- [tg\_send\_video\_note](https://docs.salebot.pro/messendzhery-i-chaty/kak-sozdat-bota-v-telegram/api-telegram-funkcii-dlya-ispolzovaniya-vsekh-vozmozhnostei-telegram/funkcii-otpravki-vlozhenii-v-soobshenii)

\- [tg\_send\_sticker](https://docs.salebot.pro/messendzhery-i-chaty/kak-sozdat-bota-v-telegram/api-telegram-funkcii-dlya-ispolzovaniya-vsekh-vozmozhnostei-telegram/funkcii-otpravki-vlozhenii-v-soobshenii)

\- [tg\_send\_contact](https://docs.salebot.pro/messendzhery-i-chaty/kak-sozdat-bota-v-telegram/api-telegram-funkcii-dlya-ispolzovaniya-vsekh-vozmozhnostei-telegram/funkcii-otpravki-vlozhenii-v-soobshenii#otpravit-kontakt-tg_send_contact)

\- [tg\_send\_venue](https://docs.salebot.pro/messendzhery-i-chaty/kak-sozdat-bota-v-telegram/api-telegram-funkcii-dlya-ispolzovaniya-vsekh-vozmozhnostei-telegram/funkcii-otpravki-vlozhenii-v-soobshenii#otpravit-geotochku-tg_send_venue)

\- [tg\_send\_video](https://docs.salebot.pro/messendzhery-i-chaty/kak-sozdat-bota-v-telegram/api-telegram-funkcii-dlya-ispolzovaniya-vsekh-vozmozhnostei-telegram/funkcii-otpravki-vlozhenii-v-soobshenii?q=#primer-koda-dlya-kopirovaniya-6)

\- [tg\_send\_animation](https://docs.salebot.pro/messendzhery-i-chaty/kak-sozdat-bota-v-telegram/api-telegram-funkcii-dlya-ispolzovaniya-vsekh-vozmozhnostei-telegram/funkcii-otpravki-vlozhenii-v-soobshenii#otpravit-animaciyu-tg_send_animation)

\- [tg\_send\_voice](https://docs.salebot.pro/messendzhery-i-chaty/kak-sozdat-bota-v-telegram/api-telegram-funkcii-dlya-ispolzovaniya-vsekh-vozmozhnostei-telegram/funkcii-otpravki-vlozhenii-v-soobshenii#otpravit-animaciyu-tg_send_animation)

\- [tg\_send\_document](https://docs.salebot.pro/messendzhery-i-chaty/kak-sozdat-bota-v-telegram/api-telegram-funkcii-dlya-ispolzovaniya-vsekh-vozmozhnostei-telegram/funkcii-otpravki-vlozhenii-v-soobshenii#otpravit-animaciyu-tg_send_animation)

\- [tg\_send\_media\_group](https://docs.salebot.pro/messendzhery-i-chaty/kak-sozdat-bota-v-telegram/api-telegram-funkcii-dlya-ispolzovaniya-vsekh-vozmozhnostei-telegram/funkcii-otpravki-vlozhenii-v-soobshenii#otpravit-media-gruppu-tg_send_media_group)

\- [tg\_send\_some\_photo](https://docs.salebot.pro/messendzhery-i-chaty/kak-sozdat-bota-v-telegram/api-telegram-funkcii-dlya-ispolzovaniya-vsekh-vozmozhnostei-telegram/funkcii-otpravki-vlozhenii-v-soobshenii#otpravit-media-gruppu-tg_send_media_group)

\- [tg\_send\_some\_video](https://docs.salebot.pro/messendzhery-i-chaty/kak-sozdat-bota-v-telegram/api-telegram-funkcii-dlya-ispolzovaniya-vsekh-vozmozhnostei-telegram/funkcii-otpravki-vlozhenii-v-soobshenii#otpravit-media-gruppu-tg_send_media_group)

\- [tg\_send\_some\_document](https://docs.salebot.pro/messendzhery-i-chaty/kak-sozdat-bota-v-telegram/api-telegram-funkcii-dlya-ispolzovaniya-vsekh-vozmozhnostei-telegram/funkcii-otpravki-vlozhenii-v-soobshenii#otpravit-media-gruppu-tg_send_media_group)

\- [tg\_send\_some\_audio](https://docs.salebot.pro/messendzhery-i-chaty/kak-sozdat-bota-v-telegram/api-telegram-funkcii-dlya-ispolzovaniya-vsekh-vozmozhnostei-telegram/funkcii-otpravki-vlozhenii-v-soobshenii#otpravit-media-gruppu-tg_send_media_group)

\- [tg\_send\_dice ](https://docs.salebot.pro/messendzhery-i-chaty/kak-sozdat-bota-v-telegram/api-telegram-funkcii-dlya-ispolzovaniya-vsekh-vozmozhnostei-telegram/funkcii-otpravki-vlozhenii-v-soobshenii#otpravit-media-gruppu-tg_send_media_group)

They automatically work with clients who have written to Telegram Business account in the same way as in bots.

{% hint style="info" %}
For more information about these methods, see the article [Telegram API](/chatbot/messengers/telegram/api.md)"
{% endhint %}


---

# Agent Instructions: 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:

```
GET https://docs.mavibot.ai/chatbot/messengers/telegram/business.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
