You've already forked OpenIntegrations
mirror of
https://github.com/Bayselonarrend/OpenIntegrations.git
synced 2025-11-27 22:18:36 +02:00
130 lines
3.3 KiB
Plaintext
Vendored
130 lines
3.3 KiB
Plaintext
Vendored
---
|
|
sidebar_position: 15
|
|
---
|
|
|
|
import Tabs from '@theme/Tabs';
|
|
import TabItem from '@theme/TabItem';
|
|
|
|
# Replace message caption
|
|
Replaces text in a message with media attachments
|
|
|
|
|
|
|
|
`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
|
|
|
|
<br/>
|
|
|
|
:::tip
|
|
Method at API documentation: [editMessageCaption](https://core.telegram.org/bots/api#editmessagecaption)
|
|
:::
|
|
<br/>
|
|
|
|
|
|
|
|
```bsl title="1C:Enterprise/OneScript code example"
|
|
Token = "6129457865:AAFyzNYOAFbu...";
|
|
ChatID = "461699897";
|
|
MessageID = "13078";
|
|
|
|
Description = "New picture description";
|
|
Result = OPI_Telegram.ReplaceMessageCaption(Token, ChatID, MessageID, Description);
|
|
```
|
|
|
|
|
|
<Tabs>
|
|
|
|
<TabItem value="bash" label="Bash" default>
|
|
```bash
|
|
oint telegram ReplaceMessageCaption \
|
|
--token "***" \
|
|
--chat "461699897" \
|
|
--message "12881" \
|
|
--caption "New picture description"
|
|
```
|
|
</TabItem>
|
|
|
|
<TabItem value="bat" label="CMD/Bat" default>
|
|
```batch
|
|
oint telegram ReplaceMessageCaption ^
|
|
--token "***" ^
|
|
--chat "461699897" ^
|
|
--message "12881" ^
|
|
--caption "New picture description"
|
|
```
|
|
</TabItem>
|
|
</Tabs>
|
|
|
|
|
|
```json title="Result"
|
|
{
|
|
"ok": true,
|
|
"result": {
|
|
"message_id": 11823,
|
|
"from": {
|
|
"id": 6129457865,
|
|
"is_bot": true,
|
|
"first_name": "Бот Виталий",
|
|
"username": "sicheebot"
|
|
},
|
|
"chat": {
|
|
"id": 461699897,
|
|
"first_name": "Anton",
|
|
"last_name": "Titowets",
|
|
"username": "JKIee",
|
|
"type": "private"
|
|
},
|
|
"date": 1739049506,
|
|
"edit_date": 1739049517,
|
|
"photo": [
|
|
{
|
|
"file_id": "AgACAgIAAxkDAAItiWeeLNPf9XjRSFgnw5iBb4GuLuwDAAKg7zEbvXzxSOXkQ0kQGEmtAQADAgADcwADNgQ",
|
|
"file_unique_id": "AQADoO8xG7188Uh4",
|
|
"file_size": 1568,
|
|
"width": 90,
|
|
"height": 67
|
|
},
|
|
{
|
|
"file_id": "AgACAgIAAxkDAAItiWeeLNPf9XjRSFgnw5iBb4GuLuwDAAKg7zEbvXzxSOXkQ0kQGEmtAQADAgADbQADNgQ",
|
|
"file_unique_id": "AQADoO8xG7188Uhy",
|
|
"file_size": 21633,
|
|
"width": 320,
|
|
"height": 240
|
|
},
|
|
{
|
|
"file_id": "AgACAgIAAxkDAAItiWeeLNPf9XjRSFgnw5iBb4GuLuwDAAKg7zEbvXzxSOXkQ0kQGEmtAQADAgADeAADNgQ",
|
|
"file_unique_id": "AQADoO8xG7188Uh9",
|
|
"file_size": 99260,
|
|
"width": 800,
|
|
"height": 600
|
|
},
|
|
{
|
|
"file_id": "AgACAgIAAxkDAAItiWeeLNPf9XjRSFgnw5iBb4GuLuwDAAKg7zEbvXzxSOXkQ0kQGEmtAQADAgADeQADNgQ",
|
|
"file_unique_id": "AQADoO8xG7188Uh-",
|
|
"file_size": 218651,
|
|
"width": 1280,
|
|
"height": 960
|
|
},
|
|
{
|
|
"file_id": "AgACAgIAAxkDAAItiWeeLNPf9XjRSFgnw5iBb4GuLuwDAAKg7zEbvXzxSOXkQ0kQGEmtAQADAgADdwADNgQ",
|
|
"file_unique_id": "AQADoO8xG7188Uh8",
|
|
"file_size": 650214,
|
|
"width": 2560,
|
|
"height": 1920
|
|
}
|
|
],
|
|
"caption": "New picture description"
|
|
}
|
|
}
|
|
```
|