You've already forked OpenIntegrations
mirror of
https://github.com/Bayselonarrend/OpenIntegrations.git
synced 2026-05-22 10:05:29 +02:00
73 lines
1.6 KiB
Plaintext
73 lines
1.6 KiB
Plaintext
---
|
|
sidebar_position: 12
|
|
---
|
|
|
|
import Tabs from '@theme/Tabs';
|
|
import TabItem from '@theme/TabItem';
|
|
|
|
# Make action button
|
|
Forms an action button for the message keyboard (see SendTextMessage)
|
|
|
|
|
|
|
|
`Function MakeActionButton(Val Text, Val Value = "", Val URL = "", Val Style = "base") Export`
|
|
|
|
| Parameter | CLI option | Type | Required | Description |
|
|
|-|-|-|-|-|
|
|
| Text | --text | String | ✔ | Button text |
|
|
| Value | --data | String | ✖ | The value returned in the event. Only if the URL is not filled |
|
|
| URL | --url | String | ✖ | URL to create the page open button. Only if the Value is not filled in |
|
|
| Style | --style | String | ✖ | Button style: primary, attention or base |
|
|
|
|
|
|
Returns: Structure - Button for keyboard
|
|
|
|
<br/>
|
|
|
|
|
|
|
|
|
|
```bsl title="1C:Enterprise/OneScript code example"
|
|
Keyboard = New Array;
|
|
ButtonsLineArray = New Array;
|
|
|
|
ButtonsLineArray.Add(OPI_VKTeams.MakeActionButton("Button1", "ButtonEvent1", , "attention"));
|
|
|
|
ButtonsLineArray.Add(OPI_VKTeams.MakeActionButton("Button2", , "https://openintegrations.dev"));
|
|
|
|
Keyboard.Add(ButtonsLineArray);
|
|
Keyboard.Add(ButtonsLineArray);
|
|
```
|
|
|
|
|
|
|
|
|
|
```json title="Result"
|
|
[
|
|
[
|
|
{
|
|
"text": "Button1",
|
|
"callbackData": "ButtonEvent1",
|
|
"style": "attention"
|
|
},
|
|
{
|
|
"text": "Button2",
|
|
"url": "https://openintegrations.dev",
|
|
"style": "base"
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"text": "Button1",
|
|
"callbackData": "ButtonEvent1",
|
|
"style": "attention"
|
|
},
|
|
{
|
|
"text": "Button2",
|
|
"url": "https://openintegrations.dev",
|
|
"style": "base"
|
|
}
|
|
]
|
|
]
|
|
```
|