Replace message caption
Replaces text in a message with media attachments
- Parameters
- Advanced call ?
Function ReplaceMessageCaption(Val Token, Val ChatID, Val MessageID, Val Description, Val Markup = "") Export
| 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 |
| 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: editMessageCaption
1C:Enterprise/OneScript code example
Token = "6129457865:AAFyzNYOAFbu...";
ChatID = "461699897";
MessageID = "17744";
Description = "New picture description";
Result = OPI_Telegram.ReplaceMessageCaption(Token, ChatID, MessageID, Description);
- Bash
- CMD/Bat
oint telegram ReplaceMessageCaption \
--token "***" \
--chat "***" \
--message "23439" \
--caption "New picture description"
oint telegram ReplaceMessageCaption ^
--token "***" ^
--chat "***" ^
--message "23439" ^
--caption "New picture description"
Result
{
"ok": true,
"result": {
"message_id": 23510,
"from": {
"id": 6129457865,
"is_bot": true,
"first_name": "Бот Виталий",
"username": "sicheebot"
},
"chat": {
"id": 461699897,
"first_name": "Anton",
"last_name": "Titovets",
"username": "bayselonarrend",
"type": "private"
},
"date": 1781804439,
"edit_date": 1781804481,
"photo": [
{
"file_id": "AgACAgIAAxkDAAJYWmoxIIGnELuKZJ2qMtH2WKAgyxw0AAIrHWsb2jCJSUt-DmDparBRAQADAgADcwADPAQ",
"file_unique_id": "AQADKx1rG9owiUl4",
"file_size": 1569,
"width": "***",
"height": 67
},
{
"file_id": "AgACAgIAAxkDAAJYWmoxIIGnELuKZJ2qMtH2WKAgyxw0AAIrHWsb2jCJSUt-DmDparBRAQADAgADbQADPAQ",
"file_unique_id": "AQADKx1rG9owiUly",
"file_size": 21511,
"width": "***",
"height": 240
},
{
"file_id": "AgACAgIAAxkDAAJYWmoxIIGnELuKZJ2qMtH2WKAgyxw0AAIrHWsb2jCJSUt-DmDparBRAQADAgADeAADPAQ",
"file_unique_id": "AQADKx1rG9owiUl9",
"file_size": 98652,
"width": "***",
"height": 600
},
{
"file_id": "AgACAgIAAxkDAAJYWmoxIIGnELuKZJ2qMtH2WKAgyxw0AAIrHWsb2jCJSUt-DmDparBRAQADAgADeQADPAQ",
"file_unique_id": "AQADKx1rG9owiUl-",
"file_size": 217083,
"width": "***",
"height": 960
},
{
"file_id": "AgACAgIAAxkDAAJYWmoxIIGnELuKZJ2qMtH2WKAgyxw0AAIrHWsb2jCJSUt-DmDparBRAQADAgADdwADPAQ",
"file_unique_id": "AQADKx1rG9owiUl8",
"file_size": 645868,
"width": "***",
"height": 1920
}
],
"caption": "New picture description"
}
}