Send GIF
Sends a GIF to a chat or channel
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
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 "@testsichee" \
--text "Строковое значение" \
--gif "/tmp/ug3aw1hd.de5"
oint telegram SendGif ^
--token "***" ^
--chat "@testsichee" ^
--text "Строковое значение" ^
--gif "/tmp/ug3aw1hd.de5"
Result
{
"ok": true,
"result": {
"message_id": 17194,
"from": {
"id": 6129457865,
"is_bot": true,
"first_name": "Бот Виталий",
"username": "sicheebot"
},
"chat": {
"id": 461699897,
"first_name": "Anton",
"last_name": "Titovets",
"username": "bayselonarrend",
"type": "private"
},
"date": 1760516465,
"animation": {
"file_name": "animation.gif.mp4",
"mime_type": "video/mp4",
"duration": 3,
"width": 220,
"height": 220,
"thumbnail": {
"file_id": "AAMCAgADGQMAAkMqaO9ZcDx9Ue9ZkEHFMGriDrRo6tUAAiiGAAI3b3lLqaqbqxQrJLkBAAdtAAM2BA",
"file_unique_id": "AQADKIYAAjdveUty",
"file_size": 11352,
"width": 220,
"height": 220
},
"thumb": {
"file_id": "AAMCAgADGQMAAkMqaO9ZcDx9Ue9ZkEHFMGriDrRo6tUAAiiGAAI3b3lLqaqbqxQrJLkBAAdtAAM2BA",
"file_unique_id": "AQADKIYAAjdveUty",
"file_size": 11352,
"width": 220,
"height": 220
},
"file_id": "CgACAgIAAxkDAAJDKmjvWXA8fVHvWZBBxTBq4g60aOrVAAIohgACN295S6mqm6sUKyS5NgQ",
"file_unique_id": "AgADKIYAAjdveUs",
"file_size": 85181
},
"document": {
"file_name": "animation.gif.mp4",
"mime_type": "video/mp4",
"thumbnail": {
"file_id": "AAMCAgADGQMAAkMqaO9ZcDx9Ue9ZkEHFMGriDrRo6tUAAiiGAAI3b3lLqaqbqxQrJLkBAAdtAAM2BA",
"file_unique_id": "AQADKIYAAjdveUty",
"file_size": 11352,
"width": 220,
"height": 220
},
"thumb": {
"file_id": "AAMCAgADGQMAAkMqaO9ZcDx9Ue9ZkEHFMGriDrRo6tUAAiiGAAI3b3lLqaqbqxQrJLkBAAdtAAM2BA",
"file_unique_id": "AQADKIYAAjdveUty",
"file_size": 11352,
"width": 220,
"height": 220
},
"file_id": "CgACAgIAAxkDAAJDKmjvWXA8fVHvWZBBxTBq4g60aOrVAAIohgACN295S6mqm6sUKyS5NgQ",
"file_unique_id": "AgADKIYAAjdveUs",
"file_size": 85181
},
"caption": "Строковое значение"
}
}