Send image
Sends an image to a chat or channel
- Parameters
- Advanced call ?
Function SendImage(Val Token, Val ChatID, Val Text, Val Image, 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 |
| Image | --picture | BinaryData, String | ✔ | Image 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 structure with fields code, body, and headers |
tip
Method at API documentation: sendPhoto
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 = "Строковое значение";
Image = "https://hut.openintegrations.dev/test_data/picture.jpg";
ImagePath = GetTempFileName("png");
CopyFile(Image, ImagePath);
ImageDD = New BinaryData(ImagePath);
// In chat, by URL
Result = OPI_Telegram.SendImage(Token, ChatID, Text, Image);
// To channel, on disk
Result = OPI_Telegram.SendImage(Token, ChannelID, Text, ImagePath);
// To channel, from binary data
Result = OPI_Telegram.SendImage(Token, ChannelID, Text, ImageDD);
- Bash
- CMD/Bat
# JSON data can also be passed as a path to a .json file
oint telegram SendImage \
--token "***" \
--chat "***" \
--text "%F0%9F%94%A5 *New release\!*\n\n%F0%9F%8F%B0 *Repository*: [240596448/devtools](https://github.com/240596448/devtools)\n%F0%9F%94%A2 *Version*: \{0.6.0}\n%F0%9F%93%85 *Date release*: 6 december 2025 y.\n\n>*AI summary*\n>Devtools - this tool for automation work with configurations\extensions 1C:Enterprise and integration with Git. Application allows dump and upload objects, a also synchronize change between Git and repository 1C. In release 0.6.0 realized optimization logic work and added logging, that contributes stability and simplifies analysis work applications.\n\n\n_Not forget put %E2%AD%90 liked projects_" \
--picture "https://hut.openintegrations.dev/test_data/picture.jpg" \
--parsemode "MarkdownV2"
:: JSON data can also be passed as a path to a .json file
oint telegram SendImage ^
--token "***" ^
--chat "***" ^
--text "%F0%9F%94%A5 *New release\!*\n\n%F0%9F%8F%B0 *Repository*: [240596448/devtools](https://github.com/240596448/devtools)\n%F0%9F%94%A2 *Version*: \{0.6.0}\n%F0%9F%93%85 *Date release*: 6 december 2025 y.\n\n>*AI summary*\n>Devtools - this tool for automation work with configurations\extensions 1C:Enterprise and integration with Git. Application allows dump and upload objects, a also synchronize change between Git and repository 1C. In release 0.6.0 realized optimization logic work and added logging, that contributes stability and simplifies analysis work applications.\n\n\n_Not forget put %E2%AD%90 liked projects_" ^
--picture "https://hut.openintegrations.dev/test_data/picture.jpg" ^
--parsemode "MarkdownV2"
Result
{
"ok": true,
"result": {
"message_id": 21152,
"from": {
"id": 6129457865,
"is_bot": true,
"first_name": "Бот Виталий",
"username": "sicheebot"
},
"chat": {
"id": 461699897,
"first_name": "Anton",
"last_name": "Titovets",
"username": "bayselonarrend",
"type": "private"
},
"date": 1777720606,
"photo": [
{
"file_id": "AgACAgIAAxkDAAJRE2nsqNuPPBY8MvjGJSJ_kAHCgcbjAAJEE2sbfTNgS7B63kbO1E7tAQADAgADcwADOwQ",
"file_unique_id": "AQADRBNrG30zYEt4",
"file_size": 1569,
"width": "***",
"height": 67
},
{
"file_id": "AgACAgIAAxkDAAJRE2nsqNuPPBY8MvjGJSJ_kAHCgcbjAAJEE2sbfTNgS7B63kbO1E7tAQADAgADbQADOwQ",
"file_unique_id": "AQADRBNrG30zYEty",
"file_size": 21511,
"width": "***",
"height": 240
},
{
"file_id": "AgACAgIAAxkDAAJRE2nsqNuPPBY8MvjGJSJ_kAHCgcbjAAJEE2sbfTNgS7B63kbO1E7tAQADAgADeAADOwQ",
"file_unique_id": "AQADRBNrG30zYEt9",
"file_size": 98652,
"width": "***",
"height": 600
},
{
"file_id": "AgACAgIAAxkDAAJRE2nsqNuPPBY8MvjGJSJ_kAHCgcbjAAJEE2sbfTNgS7B63kbO1E7tAQADAgADeQADOwQ",
"file_unique_id": "AQADRBNrG30zYEt-",
"file_size": 217083,
"width": "***",
"height": 960
},
{
"file_id": "AgACAgIAAxkDAAJRE2nsqNuPPBY8MvjGJSJ_kAHCgcbjAAJEE2sbfTNgS7B63kbO1E7tAQADAgADdwADOwQ",
"file_unique_id": "AQADRBNrG30zYEt8",
"file_size": 645868,
"width": "***",
"height": 1920
}
],
"caption": "Строковое значение"
}
}