Replace message text
Replaces the message text with a new one
- Parameters
- Advanced call ?
Function ReplaceMessageText(Val Token, Val ChatID, Val MessageID, Val Text, 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 |
| Text | --text | String | ✔ | New message text |
| 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: editMessageText
1C:Enterprise/OneScript code example
Token = "6129457865:AAFyzNYOAFbu...";
ChatID = "@testsichee";
MessageID = "22536";
Text = "New message text";
Result = OPI_Telegram.ReplaceMessageText(Token, ChatID, MessageID, Text);
- Bash
- CMD/Bat
oint telegram ReplaceMessageText \
--token "***" \
--chat "***" \
--message "27233" \
--text "<b>Bold text</b>" \
--parsemode "HTML"
oint telegram ReplaceMessageText ^
--token "***" ^
--chat "***" ^
--message "27233" ^
--text "<b>Bold text</b>" ^
--parsemode "HTML"
Result
{
"ok": true,
"result": {
"message_id": 27233,
"sender_chat": {
"id": -1001893407333,
"title": "Тестовый канал",
"username": "testsichee",
"type": "channel"
},
"chat": {
"id": -1001893407333,
"title": "Тестовый канал",
"username": "testsichee",
"type": "channel"
},
"date": 1777720592,
"edit_date": 1777720598,
"text": "New message text"
}
}