2024-06-05 12:19:46 +02:00
|
|
|
---
|
|
|
|
sidebar_position: 6
|
|
|
|
---
|
|
|
|
|
|
|
|
# Send GIF
|
|
|
|
Sends a GIF to a chat or channel
|
|
|
|
|
|
|
|
|
2024-07-10 10:59:55 +02:00
|
|
|
<br/>
|
|
|
|
|
|
|
|
|
2024-07-10 12:58:29 +02:00
|
|
|
`Function SendGif(Val Token, Val ChatID, Val Text, Val GIF, Val Keyboard = "", Val Markup = "Markdown") Export`
|
2024-06-05 12:19:46 +02:00
|
|
|
|
|
|
|
| Parameter | CLI option | Type | Destination |
|
|
|
|
|-|-|-|-|
|
|
|
|
| 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 | Keyboard JSON or path to .json |
|
|
|
|
| Markup | --parsemode | String | Text processing type (HTML, Markdown, MarkdownV2) |
|
|
|
|
|
|
|
|
|
2024-06-06 14:33:52 +02:00
|
|
|
Returns: Map Of KeyAndValue - Serialized JSON response from Telegram
|
2024-06-05 12:19:46 +02:00
|
|
|
|
2024-07-10 13:05:58 +02:00
|
|
|
<br/>
|
2024-07-10 10:59:55 +02:00
|
|
|
|
2024-07-10 12:58:29 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-05 12:19:46 +02:00
|
|
|
```bsl title="Code example"
|
2024-07-10 13:24:11 +02:00
|
|
|
Token = "6129457865:AAFyzNYOAFbu...";
|
2024-06-05 12:19:46 +02:00
|
|
|
ChatID = "461699897";
|
|
|
|
ChannelID = "@testsichee";
|
|
|
|
Text = "String value";
|
|
|
|
GIF = "https://openintegrations.dev/test_data/animation.gif";
|
|
|
|
|
|
|
|
GifPath = GetTempFileName("gif");
|
2024-06-08 19:11:43 +02:00
|
|
|
FileCopy(GIF, GifPath);
|
2024-06-05 12:19:46 +02:00
|
|
|
|
|
|
|
GifDD = New BinaryData(GifPath);
|
|
|
|
|
|
|
|
Result = OPI_Telegram.SendGif(Token, ChatID, Text, GIF);
|
2024-06-09 01:26:57 +02:00
|
|
|
Result = OPI_Telegram.SendGif(Token, ChannelID, Text, GifPath);
|
2024-06-05 12:19:46 +02:00
|
|
|
Result = OPI_Telegram.SendGif(Token, ChannelID, Text, GifDD);
|
|
|
|
```
|
2024-07-10 10:59:55 +02:00
|
|
|
|
|
|
|
|
2024-06-05 12:19:46 +02:00
|
|
|
|
|
|
|
```sh title="CLI command example"
|
|
|
|
|
|
|
|
oint telegram SendGif --token "6129457865:AAFyzNYOAFbu..." --chat "461699897" --text "String value" --gif "https://openintegrations.dev/test_data/animation.gif" --keyboard %keyboard% --parsemode %parsemode%
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
```json title="Result"
|
2024-07-10 13:11:17 +02:00
|
|
|
{
|
2024-06-05 12:19:46 +02:00
|
|
|
"ok": true,
|
|
|
|
"result": {
|
|
|
|
"message_id": 4643,
|
|
|
|
"from": {
|
|
|
|
"id": 6129457865,
|
|
|
|
"is_bot": true,
|
|
|
|
"first_name": "Vitaly The Bot",
|
|
|
|
"username": "sicheebot"
|
|
|
|
},
|
|
|
|
"chat": {
|
|
|
|
"id": 461699897,
|
|
|
|
"first_name": "Anton",
|
|
|
|
"last_name": "Titowets",
|
|
|
|
"username": "JKIee",
|
|
|
|
"type": "private"
|
|
|
|
},
|
|
|
|
"date": 1717072423,
|
|
|
|
"animation": {
|
|
|
|
"file_name": "animation.gif.mp4",
|
|
|
|
"mime_type": "video/mp4",
|
|
|
|
"duration": 3,
|
|
|
|
"width": 220,
|
|
|
|
"height": 220,
|
|
|
|
"thumbnail": {
|
|
|
|
"file_id": "AAMCAgADGQMAAhIjZlhyJr32tGqAiRbJXXmTK6ATld0AAq5QAAJgKMhKlmRvtTyqyUgBAAdtAAM1BA",
|
|
|
|
"file_unique_id": "AQADrlAAAmAoyEpy",
|
|
|
|
"file_size": 11352,
|
|
|
|
"width": 220,
|
|
|
|
"height": 220
|
|
|
|
},
|
|
|
|
"thumb": {
|
|
|
|
"file_id": "AAMCAgADGQMAAhIjZlhyJr32tGqAiRbJXXmTK6ATld0AAq5QAAJgKMhKlmRvtTyqyUgBAAdtAAM1BA",
|
|
|
|
"file_unique_id": "AQADrlAAAmAoyEpy",
|
|
|
|
"file_size": 11352,
|
|
|
|
"width": 220,
|
|
|
|
"height": 220
|
|
|
|
},
|
|
|
|
"file_id": "CgACAgIAAxkDAAISI2ZYcia99rRqgIkWyV15kyugE5XdAAKuUAACYCjISpZkb7U8qslINQQ",
|
|
|
|
"file_unique_id": "AgADrlAAAmAoyEo",
|
|
|
|
"file_size": 84940
|
|
|
|
},
|
|
|
|
"document": {
|
|
|
|
"file_name": "animation.gif.mp4",
|
|
|
|
"mime_type": "video/mp4",
|
|
|
|
"thumbnail": {
|
|
|
|
"file_id": "AAMCAgADGQMAAhIjZlhyJr32tGqAiRbJXXmTK6ATld0AAq5QAAJgKMhKlmRvtTyqyUgBAAdtAAM1BA",
|
|
|
|
"file_unique_id": "AQADrlAAAmAoyEpy",
|
|
|
|
"file_size": 11352,
|
|
|
|
"width": 220,
|
|
|
|
"height": 220
|
|
|
|
},
|
|
|
|
"thumb": {
|
|
|
|
"file_id": "AAMCAgADGQMAAhIjZlhyJr32tGqAiRbJXXmTK6ATld0AAq5QAAJgKMhKlmRvtTyqyUgBAAdtAAM1BA",
|
|
|
|
"file_unique_id": "AQADrlAAAmAoyEpy",
|
|
|
|
"file_size": 11352,
|
|
|
|
"width": 220,
|
|
|
|
"height": 220
|
|
|
|
},
|
|
|
|
"file_id": "CgACAgIAAxkDAAISI2ZYcia99rRqgIkWyV15kyugE5XdAAKuUAACYCjISpZkb7U8qslINQQ",
|
|
|
|
"file_unique_id": "AgADrlAAAmAoyEo",
|
|
|
|
"file_size": 84940
|
|
|
|
},
|
|
|
|
"caption": "String value"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|