1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-11-29 22:27:42 +02:00
Files
OpenIntegrations/docs/en/md/Telegram/Data-sending/Replace-message-text.mdx

91 lines
2.0 KiB
Plaintext
Raw Normal View History

2025-01-16 21:22:31 +03:00
---
sidebar_position: 14
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# Replace message text
Replaces the message text with a new one
`Function ReplaceMessageText(Val Token, Val ChatID, Val MessageID, Val Text) 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 |
Returns: Map Of KeyAndValue - serialized JSON response from Telegram
<br/>
:::tip
Method at API documentation: [editMessageText](https://core.telegram.org/bots/api#editmessagetext)
:::
<br/>
```bsl title="1C:Enterprise/OneScript code example"
Token = "6129457865:AAFyzNYOAFbu...";
ChatID = "@testsichee";
2025-03-18 10:00:47 +03:00
MessageID = "15569";
2025-01-16 21:22:31 +03:00
Text = "New message text";
Result = OPI_Telegram.ReplaceMessageText(Token, ChatID, MessageID, Text);
```
2025-02-10 12:36:30 +03:00
<Tabs>
<TabItem value="bash" label="Bash" default>
```bash
oint telegram ReplaceMessageText \
--token "***" \
--chat "@testsichee" \
2025-03-18 11:35:12 +03:00
--message "15651" \
2025-02-10 12:36:30 +03:00
--text "New message text"
```
</TabItem>
<TabItem value="bat" label="CMD/Bat" default>
```batch
oint telegram ReplaceMessageText ^
--token "***" ^
--chat "@testsichee" ^
2025-03-18 11:35:12 +03:00
--message "15651" ^
2025-02-10 12:36:30 +03:00
--text "New message text"
```
</TabItem>
</Tabs>
2025-01-16 21:22:31 +03:00
2025-02-09 18:15:36 +03:00
```json title="Result"
{
"ok": true,
"result": {
"message_id": 14413,
"sender_chat": {
"id": -1001893407333,
"title": "Тестовый канал",
"username": "testsichee",
"type": "channel"
},
"chat": {
"id": -1001893407333,
"title": "Тестовый канал",
"username": "testsichee",
"type": "channel"
},
"date": 1739049492,
"edit_date": 1739049498,
"text": "New message text"
}
}
```