2025-01-16 21:22:31 +03:00
---
sidebar_position: 15
2025-05-05 11:15:20 +03:00
description: Replace message caption and other functions to work with Telegram in the Open Integration Package, a free open-source integration library for 1C:Enterprise 8, OneScript and CLI
2025-05-05 09:49:19 +03:00
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, Telegram]
2025-01-16 21:22:31 +03:00
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# Replace message caption
Replaces text in a message with media attachments
2025-04-16 22:15:09 +03:00
`Function ReplaceMessageCaption(Val Token, Val ChatID, Val MessageID, Val Description, Val Markup = "") Export`
2025-01-16 21:22:31 +03:00
| Parameter | CLI option | Type | Required | Description |
|-|-|-|-|-|
| Token | --token | String | ✔ | Token |
| ChatID | --chat | String, Number | ✔ | Target chat ID |
| MessageID | --message | String, Number | ✔ | ID of message to delete |
| Description | --caption | String | ✔ | New message description |
2025-04-16 22:15:09 +03:00
| Markup | --parsemode | String | ✖ | Text processing type (HTML, Markdown, MarkdownV2) |
2025-01-16 21:22:31 +03:00
Returns: Map Of KeyAndValue - serialized JSON response from Telegram
<br/>
:::tip
Method at API documentation: [editMessageCaption](https://core.telegram.org/bots/api#editmessagecaption)
:::
<br/>
```bsl title="1C:Enterprise/OneScript code example"
2025-10-21 11:36:43 +03:00
Token = "6129457865:AAFyzNYOAFbu...";
ChatID = "461699897";
2025-10-31 15:42:42 +03:00
MessageID = "17584";
2025-01-16 21:22:31 +03:00
Description = "New picture description";
Result = OPI_Telegram.ReplaceMessageCaption(Token, ChatID, MessageID, Description);
```
2025-02-10 12:36:30 +03:00
<Tabs>
<TabItem value="bash" label="Bash" default>
```bash
oint telegram ReplaceMessageCaption \
--token "***" \
--chat "461699897" \
2025-10-31 15:42:42 +03:00
--message "17664" \
2025-02-10 12:36:30 +03:00
--caption "New picture description"
```
</TabItem>
<TabItem value="bat" label="CMD/Bat" default>
```batch
oint telegram ReplaceMessageCaption ^
--token "***" ^
--chat "461699897" ^
2025-10-31 15:42:42 +03:00
--message "17664" ^
2025-02-10 12:36:30 +03:00
--caption "New picture description"
```
</TabItem>
</Tabs>
2025-01-16 21:22:31 +03:00
2025-02-09 18:15:36 +03:00
```json title="Result"
{
"ok": true,
"result": {
2025-10-31 15:42:42 +03:00
"message_id": 17744,
2025-02-09 18:15:36 +03:00
"from": {
"id": 6129457865,
"is_bot": true,
"first_name": "Бот Виталий",
"username": "sicheebot"
},
"chat": {
"id": 461699897,
"first_name": "Anton",
2025-09-12 20:23:31 +03:00
"last_name": "Titovets",
"username": "bayselonarrend",
2025-02-09 18:15:36 +03:00
"type": "private"
},
2025-10-31 15:42:42 +03:00
"date": 1761909042,
"edit_date": 1761909062,
2025-02-09 18:15:36 +03:00
"photo": [
{
2025-10-27 16:23:35 +03:00
"file_id": "AgACAgIAAxkDAAJDlGj8qc1B91BiqhJhGAJrM2u0yJmDAALw9zEborvpS7N-L5L1PXT9AQADAgADcwADNgQ",
"file_unique_id": "AQAD8PcxG6K76Ut4",
2025-02-09 18:15:36 +03:00
"file_size": 1568,
"width": 90,
"height": 67
},
{
2025-10-27 16:23:35 +03:00
"file_id": "AgACAgIAAxkDAAJDlGj8qc1B91BiqhJhGAJrM2u0yJmDAALw9zEborvpS7N-L5L1PXT9AQADAgADbQADNgQ",
"file_unique_id": "AQAD8PcxG6K76Uty",
2025-02-09 18:15:36 +03:00
"file_size": 21633,
"width": 320,
"height": 240
},
{
2025-10-27 16:23:35 +03:00
"file_id": "AgACAgIAAxkDAAJDlGj8qc1B91BiqhJhGAJrM2u0yJmDAALw9zEborvpS7N-L5L1PXT9AQADAgADeAADNgQ",
"file_unique_id": "AQAD8PcxG6K76Ut9",
2025-02-09 18:15:36 +03:00
"file_size": 99260,
"width": 800,
"height": 600
},
{
2025-10-27 16:23:35 +03:00
"file_id": "AgACAgIAAxkDAAJDlGj8qc1B91BiqhJhGAJrM2u0yJmDAALw9zEborvpS7N-L5L1PXT9AQADAgADeQADNgQ",
"file_unique_id": "AQAD8PcxG6K76Ut-",
2025-02-09 18:15:36 +03:00
"file_size": 218651,
"width": 1280,
"height": 960
},
{
2025-10-27 16:23:35 +03:00
"file_id": "AgACAgIAAxkDAAJDlGj8qc1B91BiqhJhGAJrM2u0yJmDAALw9zEborvpS7N-L5L1PXT9AQADAgADdwADNgQ",
"file_unique_id": "AQAD8PcxG6K76Ut8",
2025-02-09 18:15:36 +03:00
"file_size": 650214,
"width": 2560,
"height": 1920
}
],
"caption": "New picture description"
}
}
```