Skip to main content

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

ParameterCLI optionTypeDescription
Text--textStringButton text
Value--dataStringThe value returned in the event. Only if the URL is not filled
URL--urlStringURL to create the page open button. Only if the Value is not filled in
Style--styleStringButton style: primary, attention or base

Returns: Structure - Button for keyboard


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);
CLI command example
    
oint vkteams MakeActionButton --text %text% --data %data% --url %url% --style %style%

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"
}
]
]