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.

Connecting the bot

Step 1. Setup in the Messengers section.

  1. 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).

Next, we connect the Telegram bot according to the instructions .

  1. If Telegram is connected.

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

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

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

At this stage, the work with the channels is completed. Go to the messenger settings.

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:

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

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

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:

Go to the bot settings:

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

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

How to disable

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:

Click the "Disable Business Account" button.

Avaliable functions

  1. (API) Function in calculator:

tg_callback(platform_id , callback_message,group_id, tg_business)

tg_callback

Parameters:

! platform_id - Telegram client ID

! callback_message - callback message

group_id - Telegram bot ID

tg_business - for working with business clients, takes the value "1".

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)

tg_send_poll

Parameters:

! platform_id - chat identifier within Telegram *

! 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 -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

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 )

tg_send_quiz_poll

! platform_id - chat identifier within Telegram *

! 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

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)

tg_send_message_1

Parameters:

! token — Telegram bot token obtained from BotFather

! platform_id — identifier of the Telegram client to which the message should be sent *

! text - message text

client_message_id - ID of the quoted message

reply_markup — button settings **

parse_mode — text formatting mode for bold or italic in the message description ***. 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"}]

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

  1. Methods

- tg_send_chat_action

- tg_send_message

- tg_send_poll

- tg_send_quiz_poll

- tg_send_video_note

- tg_send_sticker

- tg_send_contact

- tg_send_venue

- tg_send_video

- tg_send_animation

- tg_send_voice

- tg_send_document

- tg_send_media_group

- tg_send_some_photo

- tg_send_some_video

- tg_send_some_document

- tg_send_some_audio

- tg_send_dice

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

For more information about these methods, see the article Telegram API"

Last updated