Skip to main content

Send video

Sends a video to a chat or channel

Function SendVideo(Val Token, Val ChatID, Val Text, Val Video, Val Keyboard = "", Val Markup = "Markdown") Export

ParameterCLI optionTypeRequiredDescription
Token--tokenStringBot token
ChatID--chatString, NumberTarget chat ID or ChatID*TopicID
Text--textStringMessage text
Video--videoBinaryData, StringVideo file
Keyboard--keyboardString, Structure Of KeyAndValueKeyboard. See FormKeyboardFromButtonArray
Markup--parsemodeStringText processing type (HTML, Markdown, MarkdownV2)
Returns

Map Of KeyAndValue - serialized JSON response from Telegram

tip

Method at API documentation: sendVideo

Parameters with Binary data type can also accept file paths on disk and URLs


1C:Enterprise/OneScript code example
Token = "6129457865:AAFyzNYOAFbu...";
ChatID = "461699897";
ChannelID = "@testsichee";
Text = "Строковое значение";
Video = "https://hut.openintegrations.dev/test_data/video.mp4";

VideoPath = GetTempFileName("mp4");
CopyFile(Video, VideoPath);

VideoDD = New BinaryData(VideoPath);

// In chat, by URL
Result = OPI_Telegram.SendVideo(Token, ChatID, Text, Video);

// To channel, on disk
Result = OPI_Telegram.SendVideo(Token, ChannelID, Text, VideoPath);

// To channel, from binary data
Result = OPI_Telegram.SendVideo(Token, ChannelID, Text, VideoDD);
oint telegram SendVideo \
--token "***" \
--chat "***" \
--text "Строковое значение" \
--video "/tmp/jqlbg4pp.czn"
Result
{
"ok": true,
"result": {
"message_id": 21751,
"from": {
"id": 6129457865,
"is_bot": true,
"first_name": "Бот Виталий",
"username": "sicheebot"
},
"chat": {
"id": 461699897,
"first_name": "Anton",
"last_name": "Titovets",
"username": "bayselonarrend",
"type": "private"
},
"date": 1779801683,
"video": {
"duration": 5,
"width": "***",
"height": 480,
"file_name": "video",
"mime_type": "video/mp4",
"thumbnail": {
"file_id": "AAMCAgADGQMAAlT3ahWeUv7-HN7uY5IuwBqAZnhT1kIAAumcAAJywalIwDtcJd2jJogBAAdtAAM7BA",
"file_unique_id": "AQAD6ZwAAnLBqUhy",
"file_size": 19807,
"width": "***",
"height": 240
},
"thumb": {
"file_id": "AAMCAgADGQMAAlT3ahWeUv7-HN7uY5IuwBqAZnhT1kIAAumcAAJywalIwDtcJd2jJogBAAdtAAM7BA",
"file_unique_id": "AQAD6ZwAAnLBqUhy",
"file_size": 19807,
"width": "***",
"height": 240
},
"file_id": "BAACAgIAAxkDAAJU92oVnlL-_hze7mOSLsAagGZ4U9ZCAALpnAACcsGpSMA7XCXdoyaIOwQ",
"file_unique_id": "AgAD6ZwAAnLBqUg",
"file_size": 1137878
},
"caption": "Строковое значение"
}
}