1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-04-21 12:17:20 +02:00
OpenIntegrations/docs/en/md/Telegram/Data-sending/Replace-message-keyboard.mdx

53 lines
1.3 KiB
Plaintext
Raw Normal View History

2025-01-16 21:22:31 +03:00
---
sidebar_position: 13
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# Replace message keyboard
Replaces the message keyboard with a new one
`Function ReplaceMessageKeyboard(Val Token, Val ChatID, Val MessageID, Val Keyboard) 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 |
| Keyboard | --keyboard | String, Structure Of KeyAndValue | ✔ | Keyboard. See FormKeyboardFromButtonArray |
Returns: Map Of KeyAndValue - serialized JSON response from Telegram
<br/>
:::tip
Method at API documentation: [editMessageReplyMarkup](https://core.telegram.org/bots/api#editmessagereplymarkup)
:::
<br/>
```bsl title="1C:Enterprise/OneScript code example"
Token = "6129457865:AAFyzNYOAFbu...";
ChatID = "461699897";
2025-02-09 00:12:43 +03:00
MessageID = "11805";
2025-01-16 21:22:31 +03:00
ButtonArray = New Array;
ButtonArray.Add("New button 3");
ButtonArray.Add("New button 2");
ButtonArray.Add("New button 1");
Keyboard = OPI_Telegram.FormKeyboardFromButtonArray(ButtonArray, True, False);
Result = OPI_Telegram.ReplaceMessageKeyboard(Token, ChatID, MessageID, Keyboard);
```