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

95 lines
2.5 KiB
Plaintext
Raw Normal View History

2025-01-16 21:22:31 +03:00
---
sidebar_position: 14
2025-05-05 11:15:20 +03:00
description: Replace message text 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 text
Replaces the message text with a new one
2025-04-16 22:15:09 +03:00
`Function ReplaceMessageText(Val Token, Val ChatID, Val MessageID, Val Text, 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 |
| Text | --text | String | ✔ | New message text |
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: [editMessageText](https://core.telegram.org/bots/api#editmessagetext)
:::
<br/>
```bsl title="1C:Enterprise/OneScript code example"
2025-10-21 11:36:43 +03:00
Token = "6129457865:AAFyzNYOAFbu...";
ChatID = "@testsichee";
2025-10-21 21:43:05 +03:00
MessageID = "21896";
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-10-15 14:32:00 +03:00
--message "21770" \
2025-09-16 09:07:33 +03:00
--text "<b>Bold text</b>" \
--parsemode "HTML"
2025-02-10 12:36:30 +03:00
```
</TabItem>
<TabItem value="bat" label="CMD/Bat" default>
```batch
oint telegram ReplaceMessageText ^
--token "***" ^
--chat "@testsichee" ^
2025-10-15 14:32:00 +03:00
--message "21770" ^
2025-09-16 09:07:33 +03:00
--text "<b>Bold text</b>" ^
--parsemode "HTML"
2025-02-10 12:36:30 +03:00
```
</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-15 14:32:00 +03:00
"message_id": 21770,
2025-02-09 18:15:36 +03:00
"sender_chat": {
"id": -1001893407333,
"title": "Тестовый канал",
"username": "testsichee",
"type": "channel"
},
"chat": {
"id": -1001893407333,
"title": "Тестовый канал",
"username": "testsichee",
"type": "channel"
},
2025-10-15 14:32:00 +03:00
"date": 1760516118,
"edit_date": 1760516176,
2025-02-09 18:15:36 +03:00
"text": "New message text"
}
}
```