Send GIF
Sends a GIF to a chat or channel
- Parameters
- Advanced call ?
Function SendGif(Val Token, Val ChatID, Val Text, Val GIF, 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 |
| GIF | --gif | BinaryData, String | ✔ | GIF 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: sendAnimation
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 = "Строковое значение";
GIF = "https://hut.openintegrations.dev/test_data/animation.gif";
GifPath = GetTempFileName("gif");
CopyFile(GIF, GifPath);
GifDD = New BinaryData(GifPath);
// In chat, by URL
Result = OPI_Telegram.SendGif(Token, ChatID, Text, GIF);
// To channel, on disk
Result = OPI_Telegram.SendGif(Token, ChannelID, Text, GifPath);
// To channel, from binary data
Result = OPI_Telegram.SendGif(Token, ChannelID, Text, GifDD);
- Bash
- CMD/Bat
oint telegram SendGif \
--token "***" \
--chat "***" \
--text "Строковое значение" \
--gif "/tmp/omzsw1cm.msb"
oint telegram SendGif ^
--token "***" ^
--chat "***" ^
--text "Строковое значение" ^
--gif "/tmp/omzsw1cm.msb"
Result
{
"ok": true,
"result": {
"message_id": 21755,
"from": {
"id": 6129457865,
"is_bot": true,
"first_name": "Бот Виталий",
"username": "sicheebot"
},
"chat": {
"id": 461699897,
"first_name": "Anton",
"last_name": "Titovets",
"username": "bayselonarrend",
"type": "private"
},
"date": 1779801759,
"animation": {
"file_name": "animation.gif.mp4",
"mime_type": "video/mp4",
"duration": 3,
"width": "***",
"height": 220,
"thumbnail": {
"file_id": "AAMCAgADGQMAAlT7ahWennAkCj1El4r-Qv534PV3dgIAAvKcAAJywalIGSnk05p2j9wBAAdtAAM7BA",
"file_unique_id": "AQAD8pwAAnLBqUhy",
"file_size": 11342,
"width": "***",
"height": 220
},
"thumb": {
"file_id": "AAMCAgADGQMAAlT7ahWennAkCj1El4r-Qv534PV3dgIAAvKcAAJywalIGSnk05p2j9wBAAdtAAM7BA",
"file_unique_id": "AQAD8pwAAnLBqUhy",
"file_size": 11342,
"width": "***",
"height": 220
},
"file_id": "CgACAgIAAxkDAAJU-2oVnp5wJAo9RJeK_kL-d-D1d3YCAALynAACcsGpSBkp5NOado_cOwQ",
"file_unique_id": "AgAD8pwAAnLBqUg",
"file_size": 85195
},
"document": {
"file_name": "animation.gif.mp4",
"mime_type": "video/mp4",
"thumbnail": {
"file_id": "AAMCAgADGQMAAlT7ahWennAkCj1El4r-Qv534PV3dgIAAvKcAAJywalIGSnk05p2j9wBAAdtAAM7BA",
"file_unique_id": "AQAD8pwAAnLBqUhy",
"file_size": 11342,
"width": "***",
"height": 220
},
"thumb": {
"file_id": "AAMCAgADGQMAAlT7ahWennAkCj1El4r-Qv534PV3dgIAAvKcAAJywalIGSnk05p2j9wBAAdtAAM7BA",
"file_unique_id": "AQAD8pwAAnLBqUhy",
"file_size": 11342,
"width": "***",
"height": 220
},
"file_id": "CgACAgIAAxkDAAJU-2oVnp5wJAo9RJeK_kL-d-D1d3YCAALynAACcsGpSBkp5NOado_cOwQ",
"file_unique_id": "AgAD8pwAAnLBqUg",
"file_size": 85195
},
"caption": "Строковое значение"
}
}