Send video
Sends a video to a chat or channel
- Parameters
- Advanced call ?
Function SendVideo(Val Token, Val ChatID, Val Text, Val Video, Val Keyboard = "", Val Markup = "Markdown") Export
| Parameter | CLI option | Type | Required | Description |
|---|---|---|---|---|
| Token | --token | String | ✔ | Bot token |
| ChatID | --chat | String, Number | ✔ | Target chat ID or ChatID*TopicID |
| Text | --text | String | ✔ | Message text |
| Video | --video | BinaryData, String | ✔ | Video file |
| Keyboard | --keyboard | String, Structure Of KeyAndValue | ✖ | Keyboard. See FormKeyboardFromButtonArray |
| Markup | --parsemode | String | ✖ | Text processing type (HTML, Markdown, MarkdownV2) |
Returns
Map Of KeyAndValue - serialized JSON response from Telegram
| Parameter | Description |
|---|---|
| proxy | InternetProxy or a structure with fields Protocol, Host, Port, User, Password, UseOSAuthentication |
| timeout | Request execution timeout |
| adv_response | Formats the response as a complete HTTP structure with fields code, body, and headers |
| retries | Number of HTTP request send attempts on 5** status codes or internal client errors |
| dontwait | Creates a background job and returns its data (for 1C and OneScript only) |
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);
- Bash
- CMD/Bat
oint telegram SendVideo \
--token "***" \
--chat "***" \
--text "Строковое значение" \
--video "/tmp/jqlbg4pp.czn"
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": "Строковое значение"
}
}