Functions for sending attachments in messages

How to send documents

Send document tg_send_document()

! These functions allow you to send files of any type. Recommended formats: GIF, PDF, ZIP up to 2GB.

! Work with Telegram business account

tg_send_document(platform_id, document, caption, reply_markup, parse_mode,reply_to_message_id, protect_content, disable_notification, message_thread_id, entities)

Parameters:

! platform_id — client identifier in Telegram to which the message must be sent *

! document - link to the document on Telegram’s server. Getting the link via tg_request is explained here.

caption - description, up to 1024 characters

reply_markup — button settings **

parse_mode — text formatting in the caption (bold or italic) ***. Possible values: html, markdown, markdownV2. ссылка

reply_to_message_id - ID of the message to reply to (i.e., quote)

protect_content — flag to protect content from copying. To enable, pass any value other than 0, False, or empty quotes ''.

disable_notification — flag to control sound notifications (default: 0). 1 - send without notification, 0 - send with notification

message_thread_id — thread identifier (available in supergroups with forum functionality) entities — lets you reuse pre-formatted text with styles. Simply define the character offset and range for formatting. Example available in tg_request under the corresponding field. Need to be a dictionary. Example of passing the parameter: 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 this example, only the dictionary is shown, while the actual message text is defined in a separate variable.

To simplify the description of a button set, you can use the following lifehack.

Send several documents or other files tg_send_some_document()

! These functions allow you to send files of any type. Recommended formats: GIF, PDF, ZIP up to 2GB.

tg_send_some_document(platform_id, document_list, disable_notification, protect_content, reply_to_message_id, message_thread_id)

Parameters:

! platform_id — client identifier in Telegram to which the message must be sent *

! document_list - an array of documents. Example of building such an array is provided below

disable_notification — flag to control sound notifications (default: 0). 1 - send without notification, 0 - send with notification

protect_content — flag for protecting content from copying. To enable, pass any value other than 0, False, or empty quotes ''.

reply_to_message_id - ID of the message to reply to (i.e., quote)

message_thread_id — thread identifier (available in supergroups with forum functionality)

Example of building a document_list array: '[["Document link", "caption", "parse_mode"], ["Document link 2"], ["Document link 3", "caption"]]'

Data formatting example for a single document ["Document link", "caption", "parse_mode"]

The order of parameters is important! When creating an array of documents, quotation marks " " can be omitted.

Description of parameters for the document_list array: ! Document link - document link from the Telegram server. Getting the link via з tg_request is explained here caption — description up to 1024 characters parse_mode — formatting of the description, i.e., highlighting text in bold or italic ***

Example

Let’s go through an example of sending a single document, adding inline buttons and a description to the document:

  1. First, get the link to your document. A detailed explanation of how to do this can be found here.

  2. Сreate a block and set the variables as shown in the screenshot:

  3. Send the block to ourselves and see the result of our work:

Now let’s look at sending multiple documents.

  1. Here as well, you need to obtain an internal Telegram link for each document and form an array. lnkdoc='[["BQACAgIAAxkBAAIQA2O8oEMNYPTgjLvglZ63HIYYOBwFAALvHwACtjXoSXFhhNvRN6MGLQQ", "Document1"],["BQACAgIAAxkBAAIQA2O8oEMNYPTgjLvglZ63HIYYOBwFAALvHwACtjXoSXFhhNvRN6MGLQQ", "Document2"]]'

  2. Finally, put together the function for sending documents:

3. And check out the result of work:

Code example to copy

Remember that links are unique for each bot, so make sure to generate your own links

Code example for sending a single document:

lnkdoc= "BQACAgIAAxkBAAIQA2O8oEMNYPTgjLvglZ63HIYYOBwFAALvHwACtjXoSXFhhNvRN6MGLQQ"
opts = {"inline_keyboard": [[{"text": "Excellent","callback_data":"Answer1"}, {"text": "Not accepted","callback_data":"Answer2"}]]}
soob=tg_send_document(platform_id, lnkdoc, "Document sending", opts) 

Code example for sending several documents:

lnkdoc='[["BQACAgIAAxkBAAIQA2O8oEMNYPTgjLvglZ63HIYYOBwFAALvHwACtjXoSXFhhNvRN6MGLQQ", "Document1"],["BQACAgIAAxkBAAIQA2O8oEMNYPTgjLvglZ63HIYYOBwFAALvHwACtjXoSXFhhNvRN6MGLQQ", "Document2"]]'
soob=tg_send_some_document(platform_id, lnkdoc)

How to send an audio / audio voice

Send audio message tg_send_voice()

! This function allows sending voice files of type .OGG encoded with OPUS, up to 2 GB in size.

! Work only with Telegram business-account

tg_send_voice(platform_id, voice, caption, reply_markup, parse_mode, reply_to_message_id, protect_content, disable_notification, message_thread_id, entities)

Parameters:

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

! voice - link to the voice message in .OGG format

caption - оdescription up to 1024 characters

reply_markup — button settings **

parse_mode — text formatting in the description bold or italic ***. Possible values: html, markdown, markdownV2.

reply_to_message_id - ID of the message to reply to (i.e., quote)

protect_content — flag for protecting content from being copied. To enable it, pass any value except 0, False, or empty quotes ''.

disable_notification — flag for sending a message with a sound notification (default is 0) 1 - disable notification when received, 0 - send with notification

message_thread_id — topic identifier (available in supergroups if the forum feature is enabled). entities —with this parameter you can simply copy formatted text with all its features and specify from which character to which one it will be displayed with a particular style. You can check an example in tg_request in the corresponding field. The parameter must be a dictionary. 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"}] The example shows only a dictionary, while the message text itself is defined in a variable.

To simplify the button set description, you can use the following lifehack

Send several audio messages tg_send_some_audio()

! This function allows sending audio files of type .MP3 or .M4A рwith a maximum size of 2GB.

! Work with Telegram business - account

tg_send_some_audio(platform_id, audio_list, disable_notification, protect_content, reply_to_message_id, message_thread_id)

Parameters:

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

! audio_list - an array of audio files (details below)

disable_notification — flag for sending the message with or without a sound notification (default: 0). 1 — send without notification, 0 — send with notification

protect_content — flag to protect content from copying. To enable, pass any value except 0, False, or empty quotes ''.

reply_to_message_id - ID of the message to reply to (i.e., quote)

message_thread_id — topic ID (available in supergroups with forum functionality)

Example of building audio_list array: '[["Audio link 1", "caption", "parse_mode"], ["Audio link 2"], ["Audio link 3", "caption"]]'

Example of a single audio: ["Audio link", "caption", "parse_mode"]

The order of parameters is important! When building the audio files array, quotes "" can be omitted

Parameters description: ! Audio link - link to an audio file in .OGG format caption — description (up to 1024 characters) parse_mode —text formatting in the caption bold or italic ***

Example

As stated in above, the function works with .OGG files. Therefore, the first task is to obtain an audio recording in this format. If you have an .MP3 file, you can convert it to .OGG using the https://t.me/mp3toolsbot bot.

Next, send the resulting file to yourself in the bot to get the file_id following the algorithm described here.

Now put the function together:

Great! Well done!

Example to copy

Remember that links are unique for each bot, so make sure to generate your own links

Error when sending voice messages

If a message fails to send due to privacy settings, the following error is returned:

{"ok":false,"error_code":400,"description":"Bad Request: user restricted receiving of voice messages"}

Cause of the error: the user’s privacy settings contain the option “Do not receive voice messages” (either from everyone, or only allowing from certain users):

Even if the user disables this privacy restriction, the error will still continue to appear.

In fact, only completely removing the client from the Mavibot database helps to overcome this error, even though the user has already enabled permissions.

Solution:

After the user changes their privacy settings, you need to wait for a pause of 30–60 seconds (until the messenger servers process the changes), and only then send an API request to Telegram via the bot: https://api.telegram.org/bot<TOKEN>/getChat?chat_id=#{platform_id}

After this, the user data will be refreshed and voice messages will be sent correctly.

How to send animations

Send animation tg_send_animation()

! This function allows sending GIF or H.264/MPEG-4 AVC video without sound with a maximum size of 2GB.

! Work with Telegram bussiness-account

tg_send_animation(platform_id, animation, caption, reply_markup, parse_mode, reply_to_message_id, protect_content, has_spoiler, disable_notification, message_thread_id, entities, show_caption_above_media)

Parameters:

! platform_id — Telegram client ID to which the message should be sent. *

! animation- link to the animation. How to obtain a link via tg_request is explained here

caption - description up to 1024 characters

reply_markup — buttons configuration **

parse_mode —text formatting in the caption bold or italic ***. Possible values: html, markdown, markdownV2

reply_to_message_id - ID of the message to reply to (i.e., quote)

protect_content — flag to protect content from copying. To enable, pass any value other than 0, False, or empty quotes ''.

has_spoiler — enables spoiler. To enable, set True.

disable_notification — flag for sending the message with or without a sound notification (default: 0). 1 — send without notification, 0 — send with notification

message_thread_id — thread ID (available in supergroups with forum functionality) entities — with this parameter you can simply copy formatted text with all its features and specify from which character to which one it will be displayed with a particular style. You can check an example in tg_request in the corresponding field. The parameter should be a dictionary.

show_caption_above_media - if set to True, the message caption will be displayed above the media 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 this example, only the dictionary is shown, while the message text itself is stored in a variable

To simplify button set descriptions, you can use the following lifehack

Example

Let’s make the task more complex and send an animation with copy and spoiler protection.

As always, the process starts with obtaining the internal Telegram link for the selected animation (details here).

Finally, put together the function:

And check out the result of work:

Code example to copy

Remember that links are unique for each bot, so make sure to generate your own links

How to send videos

Send video using API Telegram tg_send_video()

! This function allows you to send MPEG4 files up to 2GB in size. (Other formats can be sent as files using tg_send_document())

! Work with Telegram business-account

tg_send_video(platform_id, video, caption, reply_markup, parse_mode, reply_to_message_id, protect_content, has_spoiler, disable_notification, message_thread_id, entities, show_caption_above_media, cover )

Parameters:

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

! video - video link. How yo get links via tg_request see here

caption - description up to 1024 characters

reply_markup — buttons settings **

parse_mode — text formatting in the caption bold or italic ***. Possible values: html, markdown, markdownV2.

reply_to_message_id - ID of the message to reply to (i.e., quote)

protect_content — flag to protect content from copying. To enable, pass any value other than 0, False, or empty quotes ''.

has_spoiler — enables spoiler. To enable, set True

disable_notification — flag for sending the message with a sound notification (default: 0). 1 — send without notification, 0 — send with notification

message_thread_id — thread ID (available in supergroups with forum functionality) entities — with this parameter you can simply copy formatted text with all its features and specify from which character to which one it will be displayed with a particular style. You can check an example in tg_request in the corresponding field. The parameter should be a dictionary.

show_caption_above_media - if set to True, the message text will be displayed above the media.

cover - video cover image in the message. Getting URL via tg_request is here. Example of passing parameter: 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 this example, only the dictionary is shown, while the message text itself is stored in a variable

To simplify button set descriptions, you can use the following lifehack

Send several videos using API Telegram tg_send_some_video()

! Work with Telegram business - account

tg_send_some_video(platform_id, video_list, disable_notification, protect_content, reply_to_message_id, has_spoiler, message_thread_id)

Parameters:

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

! video_list - an array of video files (details below)

disable_notification — flag for sending the message with a sound notification (default: 0). 1 — send without notification, 0 — send with notification

reply_to_message_id - ID of the message to reply to (i.e., quote)

has_spoiler — enables spoiler formatting (optional; set to True to activate)

message_thread_id — thread ID (available in supergroups with forum functionality)

Example of vuilding a video array video_list: '[["Video link1", "caption", "parse_mode"], ["Video link2"], ["Video link3", "caption"]]'

Example of building single audio : ["Video link", "caption", "parse_mode"]

The order of parameters is important! When building the video files array, quotes "" can be omitted

Parameters description: ! Video link — internal Telegram video URL. Getting the link via tg_request is described here. caption — text caption up to 1024 characters parse_mode — text formatting in the caption bold or italic ***. Possible values: html, markdown, markdownV2.

Example

So, start by obtaining the link to the file we want to send, and then fill in the required function parameters:

Getting video link via tg_request
Sending video parameter

After checking out we get the video:

Code example to copy

Remember that links are unique for each bot, so make sure to generate your own links

How to send a round video

Send round video tg_send_video_note()

! Starting from version 4.0, Telegram supports sending round MPEG4 videos with a duration of up to one minute.

! Work with Telegram business-account

tg_send_video_note(platform_id, video_note, reply_markup, protect_content, reply_to_message_id, disable_notification, message_thread_id)

Parameters:

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

! video_note - video link. How to get the link via tg_request is described here reply_markup — buttons settings **

protect_content — flag to protect content from copying. To enable, pass any value other than 0, False, or empty quotes ''

reply_to_message_id - ID of the message to reply to (i.e., quote)

disable_notification — flag for sending the message with a sound notification (default: 0). 1 — send without notification, 0 — send with notification

message_thread_id — thread ID (available in supergroups with forum functionality)

To simplify button set descriptions, you can use the following lifehack

Example

If you have a square video, you can convert it to a round one using the https://t.me/roundNoteBot bot:

Getting rounding video bot via @roundNoteBot (https://t.me/roundNoteBot)

Once you have the round video, send it to yourself in the bot to get the link (details here), and then set up the function for sending the round video:

Code example to copy

Remember that links are unique for each bot, so make sure to generate your own links

How to send a location

Send geolocation tg_send_venue()

! Work with Telegram business-account

tg_send_venue(platform_id, latitude, longitude, title, address, protect_content, disable_notification, reply_to_message_id, reply_markup, message_thread_id)

Parameters:

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

! latitude —latitude

! longitude — longitude

! title — title

! address — address

protect_content — flag to protect content from copying. To enable, pass any value other than 0, False, or empty quotes ''

disable_notification — flag for sending the message with a sound notification (default: 0). 1 — send without notification, 0 — send with notification

reply_to_message_id - ID of the message to reply to (i.e., quote)

reply_markup — buttons settings **

message_thread_id — thread ID (available in supergroups with forum functionality)

To simplify button set descriptions, you can use the following lifehack

Example

So, let’s start by determining the coordinates of the place. You can get them using Google Maps

Next, convert the obtained coordinates from decimal degrees to geographic format using any online coordinates converter:

Now, let’s proceed with filling in the function parameters and obtaining the desired result:

Code example to copy

How to send contacts

Send contact tg_send_contact()

! Work with Telegram business - account

Telegram provides a quick way to share contacts from your address book. The messenger supports sending vCard — an electronic business card

The function tg_send_contact allows sending a phone number with a first name (or organization name), as well as adding buttons and enabling content protection for the message.

tg_send_contact(platform_id, phone, first_name, last_name, protect_content, disable_notification, reply_to_message_id, reply_markup, message_thread_id)

! - required function parameter

Parameters:

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

! phone — phone number in international format. For example, for Russia: +7XXXXXXXXXX

! first_name and last_name - first name and last name

protect_content — flag to protect content from copying. To enable, pass any value other than 0, False, or empty quotes ''

disable_notification — flag for sending the message with a sound notification (default: 0). 1 — send without notification, 0 — send with notification

reply_to_message_id - ID of the message to reply to (i.e., quote)

reply_markup — buttons settings **

message_thread_id — thread ID (available in supergroups with forum functionality)

To simplify button set descriptions, you can use the following lifehack

Example

Fill in the parameters: phone number, first name, and last name.

Example of filling in the parameters for the contact-sending function.

Check out result:

Code example to copy

How to send a sticker

Send sticker tg_send_sticker()

! Work with Telegram business - account

tg_send_sticker(platform_id, sticker_id, protect_content, disable_notification, reply_to_message_id, reply_markup, message_thread_id)

Parameters:

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

! sticker_id - sticker ID. How to get a link via tg_request is explained here

protect_content — flag to protect content from copying. To enable, pass any value other than 0, False, or empty quotes ''

disable_notification — flag for sending the message with a sound notification (default: 0). 1 — send without notification, 0 — send with notification

reply_to_message_id - ID of the message to reply to (i.e., quote)

reply_markup — button settings **

message_thread_id — thread ID (available in supergroups with forum functionality)

To simplify button set descriptions, you can use the following lifehack

Example

Sending a sticker is no different from sending any other attachment: 1. Obtain the internal Telegram link (details here) 2. Fill in the function parameters 3. Send the block to yourself and check the result

Sending sticker

Result:

Code example to copy

Remember that links are unique for each bot, so make sure to generate your own links

How to send a photo

Understanding the caption parameter

Send photo tg_send_photo()

! The photo should be no larger than 10 MB. The total width and height should not exceed 10,000 pixels. The width-to-height ratio should not exceed 20.

! Work with Telegram business - account

tg_send_photo(platform_id, photo, caption, reply_markup, parse_mode, reply_to_message_id, protect_content, has_spoiler, disable_notification, message_thread_id, entities, show_caption_above_media)

Parameters:

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

! photo - link to the image. How to get a link via tg_request is explained here.

caption - description up to 1024 characters

reply_markup — buttons settings **

parse_mode — text formatting in the caption bold or italic ***

reply_to_message_id - ID of the message to reply to (i.e., quote)

protect_content — flag to protect content from copying. To enable, pass any value other than 0, False, or empty quotes ''

has_spoiler — enables spoiler formatting, set to True to activate

disable_notification — flag for sending the message with a sound notification (default: 0). 1 — send without notification, 0 — send with notification

message_thread_id — thread ID (available in supergroups with forum functionality) entities — with this parameter you can simply copy formatted text with all its features and specify from which character to which one it will be displayed with a particular style. You can check an example in tg_request in the corresponding field. The parameter should be a dictionary.

show_caption_above_media - if set to True, the message text will be displayed above the media Example of parameter sending: 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 this example, only the dictionary is shown, while the message text itself is stored in a variable

To simplify button set descriptions, you can use the following lifehack

Send several photos tg_send_some_photo()

! The photo should be no larger than 10 MB. The total width and height should not exceed 10,000 pixels. The width-to-height ratio should not exceed 20.

! Work with Telegram business-account

tg_send_some_photo(platform_id, image_list, disable_notification=0, protect_content=False, reply_to_message_id=0, has_spoiler=False,message_thread_id)

Parameters:

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

! image_list - image files array (details below)

disable_notification — flag for sending the message with a sound notification (default: 0). 1 — send without notification, 0 — send with notification

protect_content — flag to protect content from copying (optional parameter, to enable pass 1 as the value)

reply_to_message_id - ID of the message to reply to (i.e., quote)

has_spoiler — enables spoiler formatting (optional; set to True to activate)

message_thread_id — thread ID (available in supergroups with forum functionality)

Example image_list:

'[["Image link 1", "caption", "parse_mode"], ["Image link 2"], ["Image link 3", "caption"]]'

Data example for a single image: ["Image link 1", "caption", "parse_mode"]

The parameter order is important! When building the image files array, quotes "" can be omitted

Parameters description:

! Image link 1 - image link. How to get link via tg_request is explained here

caption — caption up to 1024 characters

parse_mode — text formatting in the caption bold or italic ***

Example

Let's look at an example function for sending multiple images:

first, create an image array

Next, fill in the function parameters

Send the block to yourself and enjoy the result

Code example to copy

Remember that links are unique for each bot, so make sure to generate your own links for video

How to send a dice

Send an emoji with a random selection (Dice) tg_send_dice()

tg_send_dice(platform_id, emoji, reply_markup, disable_notification, reply_to_message_id, protect_content, message_thread_id)

! Work with Telegram business - account

Parameters:

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

emoji - the emoji to be sent. If you left parameter empty, a dice will be sent by default. You can pass either the emoji itself as a string or the keyword used to represent it

reply_markup — buttons setting **

disable_notification — flag for sending the message with a sound notification (default: 0). 1 — send without notification, 0 — send with notification

reply_to_message_id -ID of the message to reply to (i.e., quote)

protect_content — flag to protect content from copying. To enable, pass any value other than 0, False, or empty quotes ''

message_thread_id — thread ID (available in supergroups with forum functionality)

To simplify button set descriptions, you can use the following lifehack

Possible emoji list: 1) 'darts' or '🎯', values from 1 to 6 2) 'dice' or '🎲', values from 1 to 6 3) 'bowling' or '🎳', values from 1 to 6 4) 'basketball' or '🏀',values from 1 to 5 5) 'football' or '⚽', values from 1 to 5 6) 'slots' or '🎰', values from 1 to 64

Additionally, if a client sends one of these emoji to the bot, you will receive a callback containing information about the score and which emoji was used.

Example

The simplest option is to call the function with only one required parameter:

In this case, the client will receive a dice:

If the client rolls the dice (by clicking on the received emoji), the bot will receive a callback with the number of points rolled:

You can experiment with this function. For example, let's create a slot machine and add a Points button. When the button is pressed, we will receive the client's total points:

First message: Offer to play
Bot example
Code example to copy

First example:

Second example:

How to send a media group

Send media group tg_send_media_group()

! Work with Telegram business - account

A method for sending a group of photos, videos, documents, or audio files as an album. On success, an array of the sent files is returned.

Note: documents and audio files cannot be grouped with other file types!

tg_send_media_group(platform_id, media_list, disable_notification, protect_content, reply_to_message_id, message_thread_id)

Parameters:

! platform_id — Telegram client ID to which the message should be sent

! media_list - an array containing from 2 to 10 photos, videos, documents, or audio files (details below);

disable_notification — flag for sending the message with a sound notification (default: 0). 1 — send without notification, 0 — send with notification

protect_content — flag to protect content from copying. To enable, pass any value other than 0, False, or empty quotes ''

reply_to_message_id - ID of the message to reply to (i.e., quote)

message_thread_id — thread ID (available in supergroups with forum functionality);

Content of the elements of media_list array:

! type - file type, “photo”, “video”, “audio” or ”document”

! media - file to send. Pass a file_id to send a file that already exists on Telegram servers (recommended), an HTTP URL for Telegram to fetch the file from the Internet or «attach://<file_attach_name>», to upload a new file using multipart/form-data with the name <file_attach_name>.

Read more: https://core.telegram.org/bots/api#sending-files

caption — title of the sending file, 0–1024 characters.

parse_mode — text formatting in the caption bold or italic

Read more: https://core.telegram.org/bots/api#sending-files

Example of media_list array:

[{"type": "photo", "media": "AgACAgIAAxkBAAIKa2W6HqQG151EaWOKnCyy8feBi8p_AAIH1zEbicvYSfi2QYj-CMreAQADAgADeAADNAQ", "caption": "ghosts video"}, {"type": "video", "media": "BAACAgIAAxkBAAIKpGW6P_HGDoVz7u4blDF6925WO-hmAALVPQACicvYSYwIWCJKwKIWNAQ", “caption”: “hare video”}]

Example

Let's look at an example function for sending multiple images:

first, create an image array

Next, fill in the function parameters

Send the block to yourself and enjoy the result

Code example to copy

Remember that links are unique for each bot, so make sure to generate your own links for video

How to send large file attachments

Example

In Telegram (both for business accounts and regular accounts), you can send attachments via a link:

  1. You can send attachments of any size, bypassing file size limits.

  2. You can also send any type of attachment you need.

How to do it:

Copy the link to an attachment that is already publicly accessible:

Then, paste the copied link into the attachment function in your block:

Done. This way, you can send attachments of any type and size.

Last updated