Telegram chat and messenger settings

Working with platform IDs in MaviBot

In MaviBot, all Telegram entities (users, groups, channels) are identified by a generic platform_id variable. This variable does not distinguish between entity types.

Problem: To use functions like accept or reject that require specific entity types, you need to know both the chat ID and the user ID separately.

Solution: When you receive a callback or message, immediately store the platform_id value in two distinct, purpose-named variables:

  • chat_id – to store the ID of the group/channel.

  • user_id – to store the ID of the individual user.

This allows you to reference the correct ID later in your application logic.

How to change the chat name via Telegram bot

Description

tg_set_group_title(platform_id, title) -

Parameters:

Parameter
Description

! platform_id

the chat ID inside Telegram *

! title

new chat name

How to change chat description via Telegram bot

Description

tg_set_chat_description(platform_id, description)

Parameter
Description

! platform_id

the chat ID inside Telegram *

! description

new chat name

How to set an avatar in a group/chat in Telegram

Description

tg_set_chat_photo(platform_id, photo)

Parameter
Description

! platform_id

chat ID inside Telegram *, in which you want to set an avatar

! photo

link photo

How to delete an avatar in a group/chat in Telegram

Description

tg_delete_chat_photo(platform_id)

Parameter
Description

! platform_id

chat ID inside Telegram *, in which you need to set an avatar

How to ban a Telegram group

Description

tg_ban_chat_sender_chat(platform_id, sender_chat_id)

Parameters:

Parameter
Description

! platform_id

chat ID inside Telegram *, which you need to ban

! sender_chat_id

chat ID which is going to ban

At the same time, the banned chat owner can't write on behalf of his /her other chats until he/ she is banned.

How to unblock Telegram group

Description

tg_unban_chat_sender_chat(platform_id, sender_chat_id)

Parameter:

Parameter
Description

! platform_id

chat ID inside Telegram *, in which you unblock

! sender_chat_id

chat ID which you unblock

Description

tg_create_chat_invite_link(platform_id, member_limit, hours, request, name)

Parameter:

Parameter
Description

! platform_id

chat ID in Telegram *

member_limit

limit on the number of participants

hours

Link expiration time (in hours)

request

a parameter that after clicking on the link, a request to join the chat should be generated.

name

link name

When passing the member_limit parameter, the value of the request parameter is automatically changed to False. If you need to accept applications for membership, then leave the member_limit parameter empty.

Creating chat invite link

Description

tg_revoke_chat_invite_link(platform_id, invite_link)

Parameters:

Parameter
Description

! platform_id

chat ID inside Telegram *

! invite_link

link that you need to delete

Description

tg_export_chat_link(platform_id)

Parameters:

Parameter
Description

! platform_id

chat ID inside Telegram *

! invite_link

link, that you need to delete

The result is - a link will be the only way to get into the group until additional links are created in other ways.

How to accept request and add user in Telegram channel/chat

Description

tg_approve_chat_join_request(chat_id, user_id)

Parameters:

! chat_id

group/channel ID inside Telegram *

! user_id

user ID inside Telegram *

Request acceptance:

How to decline request in Telegram channel/chat

Description

tg_decline_chat_join_request(chat_id, user_id)

Parameters:

! chat_id

group/channel ID inside Telegram *

! user_id

user ID inside Telegram *

Request declining

How to block user in Telegram

Description

tg_ban_chat_member(chat_id, user_id, hours)

Parameters:

Parameter
Description

! chat_id

chat ID inside Telegram *

! user_id

user ID inside Telegram * for block

hours

Block duration in hours. By default, the block is permanent. If you specify a block duration of more than 366 days, the block will be set as permanent.

How to unblock user in Telegram

Description

tg_unban_chat_member(chat_id, user_id)

Parameters:

Parameter
Description

! chat_id

chat ID inside Telegram *

! user_id

user ID inside Telegram *, who you need to unblock

How to check subscription status in Telegram

Description

tg_get_chat_member(chat_id, user_id)

Parameters:

Parameter
Description

! chat_id

chat ID inside Telegram *

! user_id

user ID inside Telegram *, whose subscription we are checking

How to determine the number of members in channel/chat

Description

tg_get_chat_member_count(platform_id)

Parameters:

Parameter
Description

! platform_id

chat ID in Telegram *

How to check if a chat member is in a specific list

some_client_in_list(list_id, recepient)

Parameters:

Parameter
Description

! list_id

list number

! recepient

user's ID inside Telegram *. For chat clients, this value is in the chat_member_id variable.

How to show bot's actions to the user (print/select a sticker and ect.)

Description

tg_send_chat_action(platform_id, bot_action, message_thread_id)

! Work with Telegram business-account

Parameters:

Parameter
Description

! platform_id

chat ID in Telegram *

! bot_action

bot's action from the list

message_thread_id

topic ID (available for supergroups if the forum functionality is available).

Available actions list bot_action

typing for text messages, upload_photo for photos, record_video or upload_video for videos , record_voice or upload_voice for voice notes, upload_document for common documents, choose_sticker for stickers, find_location for location data, record_video_note or upload_video_note for video note.

This notification will be displayed until any response is received from the bot, but no more than 5 seconds.

How to show Alert-notification to the user

Description

tg_answer_callback_query(callback_query_id, text,show_alert,cache_time)

Parameter
Description

! callback_query_id (required)

This ID allows you to identify the person who clicked the button and show him/her the Alert notification.

! text (required)

Text of Alert-notification.

show_alert

Indication of disappearing notification (False — a fading tooltip-style notification, True — a persistent window notification)

cache_time

The maximum amount of time, in seconds, during which the result of a callback request can be cached on the client side. Telegram applications will support caching starting from version 3.14. The default value is 0

Example

Alert notifications are shown only as a result of clicking on the callback button in Telegram.

For example, we use the following buttons:

[{"line":0,"index_in_line":0,"text":"111","type":"inline","callback":"first"}, {"line":1,"index_in_line":0,"text":"222","type":"inline","callback":"second"}, {"line":2,"index_in_line":0,"text":"333","type":"inline","callback":"third"}]

After clicking a button, a callback arrives with the text contained in the corresponding field. When you click on the “111” button, you will receive a callback with the text “first".

Let’s create a Start block and specify the desired text in the trigger. In our case: "first

If in the Matches field you select Ignoring errors and inaccuracies, this block can later be reused for all similar variants that differ by 1–2 characters. For example, to thank the user for providing a rating with such a button.

Next, in the calculator, use the tg_answer_callback_query function and pass the following parameters: callback_query_id - this ID allows you to identify the user who pressed the button and display Alert - notification to them text - text Alert-notification.

Code example to copy:

tg_answer_callback_query('#{callback_query_id}', "You pressed the button 111")

If everything is set up correctly, pressing the button will result in an Alert - notification with the specified text. In the mobile version, the bot’s name will appear as the header above the text.

If you want to show a simple popup message instead, pass False as the third parameter, as shown in the example below: tg_answer_callback_query('#{callback_query_id}', "You passed the button 222", False)

When the button is pressed with these parameters, a notification of this type will appear for a few seconds.

Adding a bot redirect with a tag as a callback button responses

Description

tg_callback_url_open(callback_query_id, url, cache_time)

Parameters:

Parameters
Description

! callback_query_id

This ID allows you to identify the person who clicked the button and show him/her the Alert notification.

! url

URL-pointing to the bot and a parameter (format: t.me/your_bot?start=XXXX, where your_bot - is bot's name)

cache_time

The maximum amount of time, in seconds, during which the result of a callback request can be cached on the client side. Telegram applications will support caching starting from version 3.14. The default value is 0

Example

ВIn the callback button response, you can add a transition to the bot using tag thetg_callback_url_open('#{callback_query_id}', 't.me/bot_name?start=XXXX')

For example, let’s use the following buttons:

[{"line":0,"index_in_line":0,"text":"111","type":"inline","callback":"first"}, {"line":1,"index_in_line":0,"text":"222","type":"inline","callback":"second"}, {"line":2,"index_in_line":0,"text":"333","type":"inline","callback":"third"}]

After clicking a button, a callback arrives with the text contained in the corresponding field. When you click on the “111” button, you will receive a callback with the text “first".

Create a block with a primary condition check and specify the desired text in the condition. In our case: “first”:

If in the Matching option field you select Ignore errors and inaccuracies, this block can later be reused for all similar variants that differ by 1–2 characters. For example, to thank the user for providing a rating with such a button.

Next, in the block’s calculator, specify tg_callback_url_open('#{callback_query_id}', 't.me/bot_name?start=XXXX'):

How to promote a user to administrator in a supergroup or channel

Description

tg_promote_user(platform_id, user_id, promote_options_list)

Parameters:

Parameter
Description

! platform_id

the identifier of a supergroup or, if used in a channel, the channel username in the format @channelusername inside Telegram *

! user_id

the identifier of a user inside Telegram. *

! promote_options_list

list of permissions to be enabled.

Required parameter: promote_options_list

The following permissions can be specified in the promote_options_list :

  1. is_anonymous — пhides the administrator’s presence in the chat,

  2. can_manage_chat — the administrator can access the chat event log, chat statistics, message statistics in channels, view channel members, view anonymous administrators in supergroups, and bypass slow mode. This permission level is granted by default if any of the subsequent privileges are specified

  3. can_post_messages — — the administrator can create channel posts (channels only)

  4. can_edit_messages — the administrator can edit other users’ messages and pin messages (channels only)

  5. can_delete_messages — the administrator can delete other users’ messages

  6. can_manage_video_chats — he administrator can manage video chats,

  7. can_restrict_members — the administrator can restrict members, ban/unban them in the chat,

  8. can_promote_members — the administrator can appoint new administrators with a subset of their own privileges, or demote administrators whom they have appointed directly or indirectly (e.g., administrators appointed by them)

  9. can_change_info — the administrator can change the chat title, photo, and other settings

  10. can_invite_users — the administrator can invite new users to the chat

  11. can_pin_messages — the administrator can pin messages (supergroups only).

Example

Example: Promoting a user to administrator in a supergroup:

In this example, in addition to the specified permissions, the can_manage_chat permission will be granted by default.

Assigning permissions to a user
Setting a custom administrator title

Code example to copy

How to change an administrator title using a bot in Telegram

Description

tg_set_administrator_title(platform_id, user_id, title)

Parameters:

Parameter
Descroption

! platform_id

identifier of the supergroup inside Telegram *

! user_id

identifier of the user inside Telegram *

! title

administrator title

Restrictions for title:

Length: 0–16 characters, emojis are not allowed

Code example to copy:

General restrictions for regural chat members or specific Telegram users

Description

tg_chat_permission(platform_id, permission, media_permissions)

Parameters:

Parameter
Description

! platform_id

identifier of the chat inside Telegram *

! permission

an array of values from the restriction list (see below).

1 = action is allowed

0 = action is forbidden

Array index corresponds to the position in the restriction lis

! media_permissions

an array of values defining media-related permissions (details below).

1 = action is allowed

0 = action is forbidden

Array index corresponds to the position in the media permission list

List of restrictions for the required parameter permission

List of restrictions for permission: 1. ! can_send_messages - permission to send text messages, contacts, locations, and venues. 2. ! can_send_media_messages - permission to send audio, documents, photos, videos, video notes, and voice notes. It requires can_send_messages 3. ! can_send_polls - permission to send polls. It requires can_send_messages 4. ! can_send_other_messages - permission to send animations, games, stickers, and to use inline bots. It requires can_send_media_messages 5. ! can_add_web_page_previews - permission to add web-page previews to messages. It requires can_send_media_messages 6. ! can_change_info - permission to change the chat title, photo, and other settings. This is ignored in public supergroups. 7. ! can_invite_users - permission to invite users 8. ! can_pin_messages - permission to pin messages. This is ignored in public supergroups. 9. can_manage_topics - permission to create topics in forum groups. If used in a group of the wrong type, the function will fail and return an error.

List of values for the required parameter media_permissions

1. can_send_audios - permission to send audio files 2. can_send_documents -permission to send documents 3. can_send_photos - permission to send photos 4. can_send_videos - permission to send videos 5. can_send_video_notes - permission to send round video messages 6. can_send_voice_notes - permission to send voice messagesя

Telegram Personal restrictions for regular chat users or for specific Telegram users

Description

tg_restrict_chat_member(platform_id, user_id, minutes, permission, media_permissions).

Parameters:

Parameter
Description

! platform_id

chat ID in Telegram *

! user_id

user ID in Telegram *

minutes

the number of minutes during which the restriction will stay active. If you do not set a value, the default is 3600, which equals 60 hours. If you set it to 0, the restriction becomes permanent

permission

an array of values from the permission restriction list.

media_permissions

a list of values for granting media-related permissions

List of restrictions for the required parameter permission

List of restrictions for permission: 1. ! can_send_messages - permission to send text messages, contacts, locations, and venues. 2. ! can_send_media_messages - permission to send audio, documents, photos, videos, video notes, and voice notes. It requires can_send_messages 3. ! can_send_polls - permission to send polls. It requires can_send_messages 4. ! can_send_other_messages - permission to send animations, games, stickers, and to use inline bots. It requires can_send_media_messages 5. ! can_add_web_page_previews - permission to add web-page previews to messages. It requires can_send_media_messages 6. ! can_change_info - permission to change the chat title, photo, and other settings. This is ignored in public supergroups. 7. ! can_invite_users - permission to invite users 8. ! can_pin_messages - permission to pin messages. This is ignored in public supergroups. 9. can_manage_topics - permission to create topics in forum groups. If used in a group of the wrong type, the function will fail and return an error.

List of values for the required parameter media_permissions

1. can_send_audios - permission to send audio files 2. can_send_documents -permission to send documents 3. can_send_photos - permission to send photos 4. can_send_videos - permission to send videos 5. can_send_video_notes - permission to send round video messages 6. can_send_voice_notes - permission to send voice messagesя

Example

Example of using the function, where the user is restricted from everything for 3 minutes:

When the user enters the chat, they will see a notification that they cannot send messages in the chat. If a time limit is set, they will also see the duration of this restriction.

Code example to copy:

How to pin message

Description

tg_pin_chat_message(platform_id, message_id, disable_notification)

Parameters:

Parameter
Description

! platform_id

chat ID inside Telegram *

message_id

message ID that needs to pin

disable_notification

The parameter defines whether a notification should be sent to all chat members about a new pinned message (notifications are always disabled in channels and private chats). If you do not want to send notifications, set the parameter disable_notification to 1. Otherwise, set it to 0.

How to unpin message

Description

tg_unpin_chat_message(platform_id, message_id)

Parameters:

Parameter
Description

! platform_id

chat ID inside Telegram *

message_id

ID of the message that should be unpinned. If message_id is not provided, the most recent pinned message (by send date) will be unpinned

How to unpin all pinned messages

Description

tg_unpin_all(platform_id)

Parameters:

Parameter
Description

! platform_id

chat ID inside Telegram *

How to create a poll in Telegram

Description

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)

Parameters:

Parameter
Description

! platform_id

chat ID in Telegram *

! question

question

! options

an array of answer options

is_anonymous

1 - anonymous survey , '' - not anonymous

allows_multiple_answers

1 - multiple answers are available, '' - one answer

reply_markup

keyboard or '' - without keyboard

disable_notification

flag for sending with sound notification (default 0) 1 – disable notification on receipt, 0 – send with notification

protect_content

1 to protect from copying and screenshots, '' no protection

token

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

reply_to_message_id

ID of quoted message

message_thread_id

thread ID (available for supergroups if forum functionality exists)

business_connection_id

value when connecting a bot (Business ID). Shows in channels. Should be provided if the bot token is used and the message must be sent through a user account connected to the bot

Important to know!

Notes

1. The function returns a response from Telegram with message_id. It is better to save it. Using message_id, you can stop the poll with tg_stop_poll (see description below) and get the result.

2. If a user adds a poll in a messenger, a callback is sent to the chat:

poll_added - неизменная часть YOUR QUESTION - текст вопроса из опроса

Пример колбека при добавлении опроса в канал

Пример колбека при добавлении опроса в чат

Второй колбек после poll_added содержит цифры - это не что иное, как идентификатор пользователя в Telegram, который добавил опрос.

3. В канале можно создавать только анонимные опросы

Внимание, рекомендуется отправлять в группу только анонимные опросы!

4. После создания опроса в переменную сохраните его идентификатор, чтобы понимать на какой опрос пришел колбек.

Example

Client feedback is key to our growth. Polls offer a straightforward method to capture this feedback and translate it into concrete business conclusions.

Code example for copying:

Function for creating a poll in Telegram:

The poll we created in Telegram

How to create a quiz in Telegram

Description

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 )

Parameters:

Parameter
Description

! platform_id

chat ID inside Telegram *

! question

question

! options

an array of answer options

! explanation

text displayed when a user selects a wrong answer or clicks the lamp icon in a quiz-style poll, 0–200 characters with no more than two line breaks after entity parsing.

! correct_option_id

номер правильного ответа, нумерация с 1

is_anonymous

1 - anonymous survey , '' - not anonymous

reply_markup

keyboard or '' - without keyboard

parse_mode

explanation format: markdown, html, or '' (empty string for no formatting)

protect_content

1 to protect from copying and screenshots, '' no protection

disable_notification

flag for sending with sound notification (default 0) 1 – disable notification on receipt, 0 – send with notification

token

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

reply_to_message_id

quoted message ID

message_thread_id

topic ID (available in supergroups with active forum features)

Important to know!

Notes

1. Save the message_id

The API function returns a Telegram response containing a message_id. Always save this ID, as it is required to:

  • End the quiz using the tg_stop_poll function (see description below).

  • Retrieve the final results.

2. Callback poll_added

If a user adds a poll to a channel, the bot receives a callback:

  • Format: poll_added + Poll question

  • If added to a group chat: the callback also includes the Telegram User ID of the person who added the poll.

3. Channel restriction

Only anonymous quizzes can be created in channels.

4. Callback poll_answer (User voting)

When a user votes in a quiz sent to a private chat or group, a callback is sent to the bot's dialog with that client:

  • Format: poll_answer + Poll ID + [Answer index]

  • Example: poll_answer 5325838371359031648 [3]

  • Note: answer numbering starts from 0. [3] means the user selected the fourth answer option.

5. Webhook for non-anonymous group polls

For non-anonymous polls in groups where the bot is an admin, a webhook is sent for every vote. Upon receiving it, the bot will forward the poll_answer callback (as in point 4) to its dialog with the corresponding client.

6. Activation requirement & best practice

  • Requirement: a bot cannot initiate a conversation. If a client has never contacted the bot, you cannot send them a direct message in response to their vote until they activate the bot first (e.g., by sending a /start command).

Recommendation: to avoid this limitation, it is highly recommended to send only anonymous quizzes to groups.

7. Track your polls

Immediately after creating a quiz, save its unique Poll ID to a variable. This allows you to identify which specific poll an incoming callback refers to.

Example

Code example for copying.

Example: quiz creation.

How to end a poll

Description

tg_stop_poll(platform_id, message_id)

Parameters:

Parameter
Description

! platform_id

chat ID in Telegram *

! message_id

poll/quiz message ID. It can be obtained from the webhook

Calling this function to end a poll/quiz returns a dictionary containing the final results.

How to work with topics in Telegram

How to rename group's General Topic

Description

tg_edit_general_forum_topic(platform_id, topic_name)

Parameters:

Parameter
Description

! platform_id

chat ID inside Telegram *

! topic_name

new topic name

bot_name

optional parameter: bot name.

When working with topics, you can specify which bot should execute the function. This is useful if your project uses multiple Telegram bots. Find the bot name in the "Channels" section, in the "Group ID" field.

Example

The groups' General Topic can be changed using the tg_edit_general_forum_topic() function. It requires two mandatory parameters: the chat ID and the new name for the Group Topic:

Code example for copying

rename the General Topic chat/ answer = tg_edit_general_forum_topic(-1001839380031, 'General')

How to close General Topic

Description

tg_close_general_forum_topic(platform_id)

Parameters:

Parameter
Description

! platform_id

chat ID inside Telegram *

bot_name

optional parameter: bot name.

When working with topics, you can specify which bot should execute the function. This is useful if your project uses multiple Telegram bots. Find the bot name in the "Channels" section, in the "Group ID" field.

Code example for copying

/close the General Topic chat/ answer = tg_close_general_forum_topic(-1001839380031)

How to reopen a previously closed General Topic

Description

tg_reopen_general_forum_topic(platform_id)

Parameters:

Parameter
Description

! platform_id

chat ID inside Telegram *

bot_name

optional parameter: bot name.

When working with topics, you can specify which bot should execute the function. This is useful if your project uses multiple Telegram bots. Find the bot name in the "Channels" section, in the "Group ID" field.

Code exmaple for copying

/reopen the General Topic chat/ answer = tg_reopen_general_forum_topic(-1001839380031)

How to hide General Topic

Description

tg_hide_general_forum_topic(platform_id)

Parameters:

Parameter
Description

! platform_id

chat ID inside Telegram *

bot_name

optional parameter: bot name.

When working with topics, you can specify which bot should execute the function. This is useful if your project uses multiple Telegram bots. Find the bot name in the "Channels" section, in the "Group ID" field.

The General Topic chat can be closed for the Topic's participants (they can read but not write) and hidden from Telegram's general chat list for new users.

Code example for copying

/hide the General Topic chat/ answer = tg_hide_general_forum_topic(-1001839380031)

How to display General Topic or restore its visibility

Description

tg_unhide_general_forum_topic(platform_id)

Parameters:

Parameter
Description

! platform_id

topic ID inside Telegram *

bot_name

optional parameter: bot name.

When working with topics, you can specify which bot should execute the function. This is useful if your project uses multiple Telegram bots. Find the bot name in the "Channels" section, in the "Group ID" field.

Code example for copying

/display the General Topic chat/ answer = tg_unhide_general_forum_topic(-1001839380031)

How to create a new topic in Telegram

Description

tg_create_forum_topic(platform_id, name, icon, icon_color)

Parameters:

Parameter
Description

! platform_id

chat ID inside Telegram *

! name

new topic name

icon

emoji ID to be set for the topic. Passed as a string. You can only use emojis from the list retrieved by the tg_get_forum_icon function.

icon_color

emoji color from the list: 7322096, 16766590, 13338331, 9367192, 16749490, 16478047. Not all emojis support color changes.

bot_name

optional parameter: bot name.

When working with topics, you can specify which bot should execute the function. This is useful if your project uses multiple Telegram bots. Find the bot name in the "Channels" section, in the "Group ID" field.

The set color cannot be changed; color can only be assigned when creating the topic.

When executed, the function will return a response containing the parameters of the new topic, including the topic ID (required for various functions).

Code example for copying

To create an additional topic chat answer = tg_create_forum_topic(-1001839380031, 'second_bot_topic', None, 7322096)

To save the created additional topic chat ID answer={"ok":true,"result":{"message_thread_id":254,"name":"second_bot_topic","icon_color":7322096}}/ idtema1=answer['result']['message_thread_id']

How to edit a topic. How to rename and/or change the emoji for a topic

Description

tg_edit_forum_topic(platform_id, message_thread_id, name, icon)

Parameters:

Parameter
Description

! platform_id

chat ID inside Telegram *

! message_thread_id

additional topic chat ID

name

new topic name

icon

emoji ID to be set for the topic. Passed as a string. You can only use emojis from the list retrieved by the tg_get_forum_icon function.

bot_name

optional parameter: bot name.

When working with topics, you can specify which bot should execute the function. This is useful if your project uses multiple Telegram bots. Find the bot name in the "Channels" section, in the "Group ID" field.

Code example for copying

answer = tg_edit_forum_topic(-1001839380031, 254)

How to close a selected topic

Description

Closing a topic means making it read-only; writing in a closed topic is not allowed.

tg_close_forum_topic(platform_id, message_thread_id)

Parameters:

Parameter
Description

! platform_id

chat ID inside Telegram *

! message_thread_id

additional topic chat ID

bot_name

optional parameter: bot name.

When working with topics, you can specify which bot should execute the function. This is useful if your project uses multiple Telegram bots. Find the bot name in the "Channels" section, in the "Group ID" field.

Code example for copying

answer = tg_close_forum_topic(-1001839380031, 254)

How to reopen a previously closed topic

Description

tg_reopen_forum_topic(platform_id, message_thread_id)

Parameters:

Parameter
Description

! platform_id

chat ID inside Telegram *

! message_thread_id

additional topic chat ID

bot_name

optional parameter: bot name.

When working with topics, you can specify which bot should execute the function. This is useful if your project uses multiple Telegram bots. Find the bot name in the "Channels" section, in the "Group ID" field.

Code example for copying

answer = tg_reopen_forum_topic(-1001839380031, 254)

How to delete a topic and all its messages

Description

tg_delete_forum_topic(platform_id, message_thread_id)

Parameters:

Parameter
Description

! platform_id

chat ID inside Telegram *

! message_thread_id

additional topic chat ID

bot_name

optional parameter: bot name.

When working with topics, you can specify which bot should execute the function. This is useful if your project uses multiple Telegram bots. Find the bot name in the "Channels" section, in the "Group ID" field.

Code example for copying

answer = tg_delete_forum_topic(-1001839380031, 254)

How to unpin all messages in a topic

Description

tg_unpin_topic_messages(platform_id, message_thread_id)

Parameters:

Parameter
Description

! platform_id

chat ID inside Telegram *

! message_thread_id

additional topic chat ID

bot_name

optional parameter: bot name.

When working with topics, you can specify which bot should execute the function. This is useful if your project uses multiple Telegram bots. Find the bot name in the "Channels" section, in the "Group ID" field.

Code example for copying

answer = tg_unpin_topic_messages(-1001839380031, 254)

How to get the list of emojis for a Telegram Topic

Description

How to get the list of emojis

tg_get_forum_icon() – this function returns a list of emojis available for use as forum topic icons. The result must be assigned to a variable, as it returns a dictionary where each key is an emoji and its corresponding value is the emoji's unique identifier (id).

Parameters: none.

The content of the emoji list

To get the list of emojis for a Topic chat, send the command to the relevant chat.

The function will return the emoji list in its response. This means the variable answer will contain a dictionary as its value.

{'📰': '5434144690511290129', '💡': '5312536423851630001', '⚡️': '5312016608254762256', '🎙': '5377544228505134960', '🔝': '5418085807791545980', '🗣': '5368697802761185083', '🆒': '5420216386448270341', '❗️': '5379748062124056162', '📝': '5357193964787081133', '📆': '5433614043006903194', '📁': '5357315181649076022', '🔎': '5309965701241379366', '📣': '5309984423003823246', '🔥': '5312241539987020022', '❤️': '5312138559556164615', '❓': '5377316857231450742', '📈': '5350305691942788490', '📉': '5350713563512052787', '💎': '5309958691854754293', '💰': '5350452584119279096', '💸': '5309929258443874898', '\U0001fa99': '5377690785674175481', '💱': '5310107765874632305', '⁉️': '5377438129928020693', '🎮': '5309950797704865693', '💻': '5350554349074391003', '📱': '5409357944619802453', '🚗': '5312322066328853156', '🏠': '5312486108309757006', '💘': '5310029292527164639', '🎉': '5310228579009699834', '‼️': '5377498341074542641', '🏆': '5312315739842026755', '🏁': '5408906741125490282', '🎬': '5368653135101310687', '🎵': '5310045076531978942', '🔞': '5420331611830886484', '📚': '5350481781306958339', '👑': '5357107601584693888', '⚽️': '5375159220280762629', '🏀': '5384327463629233871', '📺': '5350513667144163474', '👀': '5357121491508928442', '\U0001fae6': '5357185426392096577', '🍓': '5310157398516703416', '💄': '5310262535021142850', '👠': '5368741306484925109', '✈️': '5348436127038579546', '\U0001f9f3': '5357120306097956843', '🏖': '5310303848311562896', '⛅️': '5350424168615649565', '🦄': '5413625003218313783', '🛍': '5350699789551935589', '👜': '5377478880577724584', '🛒': '5431492767249342908', '🚂': '5350497316203668441', '🛥': '5350422527938141909', '🏔': '5418196338774907917', '🏕': '5350648297189023928', '🤖': '5309832892262654231', '\U0001faa9': '5350751634102166060', '🎟': '5377624166436445368', '🏴\u200d☠️': '5386395194029515402', '🗳': '5350387571199319521', '🎓': '5357419403325481346', '🔭': '5368585403467048206', '🔬': '5377580546748588396', '🎶': '5377317729109811382', '🎤': '5382003830487523366', '🕺': '5357298525765902091', '💃': '5357370526597653193', '\U0001fa96': '5357188789351490453', '💼': '5348227245599105972', '\U0001f9ea': '5411138633765757782', '👨\u200d👩\u200d👧\u200d👦': '5386435923204382258', '👶': '5377675010259297233', '🤰': '5386609083400856174', '💅': '5368808634392257474', '🏛': '5350548830041415279', '\U0001f9ee': '5355127101970194557', '🖨': '5386379624773066504', '👮\u200d♂️': '5377494501373780436', '\U0001fa7a': '5350307998340226571', '💊': '5310094636159607472', '💉': '5310139157790596888', '\U0001f9fc': '5377468357907849200', '\U0001faaa': '5418115271267197333', '🛃': '5370947704199323325', '🍽': '5350344462612570293', '🐟': '5384574037701696503', '🎨': '5310039132297242441', '🎭': '5350658016700013471', '🎩': '5357504778685392027', '🔮': '5350367161514732241', '🍹': '5350520238444126134', '🎂': '5310132165583840589', '☕️': '5350392020785437399', '🍣': '5350406176997646350', '🍔': '5350403544182694064', '🍕': '5350444672789519765', '\U0001f9a0': '5312424913615723286', '💬': '5417915203100613993', '🎄': '5312054580060625569', '🎃': '5309744892677727325'}

Code example for copying

Last updated