1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-11-27 22:18:36 +02:00
Files
OpenIntegrations/docs/en/md/Viber/Message-sending/Create-keyboard-from-array-button.mdx
Vitaly the Alpaca (bot) abbcdf3723 Main build (Jenkins)
2025-09-18 13:55:48 +03:00

86 lines
2.0 KiB
Plaintext
Vendored

---
sidebar_position: 7
description: Create a keyboard from an array of buttons and other functions to work with Viber in the Open Integration Package, a free open-source integration library for 1C:Enterprise 8, OneScript and CLI
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, Viber]
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# Create a keyboard from an array of buttons
Returns a keyboard structure for messages
`Function CreateKeyboardFromArrayButton(Val ButtonArray, Val ButtonColor = "#2db9b9") Export`
| Parameter | CLI option | Type | Required | Description |
|-|-|-|-|-|
| ButtonArray | --buttons | Array of String | ✔ | Array of buttons |
| ButtonColor | --color | String | ✖ | HEX color of buttons with # at the beginning |
Returns: Structure - Create a keyboard from an array of buttons:
<br/>
```bsl title="1C:Enterprise/OneScript code example"
ButtonArray = New Array;
ButtonArray.Add("Button 1");
ButtonArray.Add("Button 2");
ButtonArray.Add("Button 3");
Result = OPI_Viber.CreateKeyboardFromArrayButton(ButtonArray);
```
<Tabs>
<TabItem value="bash" label="Bash" default>
```bash
oint viber CreateKeyboardFromArrayButton \
--buttons "['Button 1','Button 2','Button 3']"
```
</TabItem>
<TabItem value="bat" label="CMD/Bat" default>
```batch
oint viber CreateKeyboardFromArrayButton ^
--buttons "['Button 1','Button 2','Button 3']"
```
</TabItem>
</Tabs>
```json title="Result"
{
"Buttons": [
{
"ActionType": "reply",
"ActionBody": "Button 1",
"Text": "Button 1",
"BgColor": "#2db9b9",
"Coloumns": 3
},
{
"ActionType": "reply",
"ActionBody": "Button 2",
"Text": "Button 2",
"BgColor": "#2db9b9",
"Coloumns": 3
},
{
"ActionType": "reply",
"ActionBody": "Button 3",
"Text": "Button 3",
"BgColor": "#2db9b9",
"Coloumns": 3
}
],
"Type": "keyboard"
}
```