N
N
Nikita2019-08-19 06:16:08
In contact with
Nikita, 2019-08-19 06:16:08

How to make the buttons for the VK API bot be in a row, and not one after another?

What parameter to set so that the buttons are in a row as in the screenshot?
5d5a1424b0654146371493.png
And here nothing is really written
5d5a1444ec4d3573364699.png
ps I’ve been sitting for half an hour uploading an example code with the VK API, I still don’t understand anything
Here is the official example itself

{
    "one_time": false,
    "buttons": [
        [{
            "action": {
                "type": "location",
                "payload": "{\"button\": \"1\"}"
            }
        }],
        [{
            "action": {
                "type": "open_app",
                "app_id": 6979558,
                "owner_id": -181108510,
                "hash": "sendKeyboard",
                "label": "Отправить клавиатуру"
            }
        }],
        [{
            "action": {
                "type": "vkpay",
                "hash": "action=transfer-to-group&group_id=181108510&aid=10"
            }
        }],
        [{
                "action": {
                    "type": "text",
                    "payload": "{\"button\": \"1\"}",
                    "label": "Negative"
                },
                "color": "negative"
            },
            {
                "action": {
                    "type": "text",
                    "payload": "{\"button\": \"2\"}",
                    "label": "Positive"
                },
                "color": "positive"
            },
            {
                "action": {
                    "type": "text",
                    "payload": "{\"button\": \"2\"}",
                    "label": "Primary"
                },
                "color": "primary"
            },
            {
                "action": {
                    "type": "text",
                    "payload": "{\"button\": \"2\"}",
                    "label": "Secondary"
                },
                "color": "secondary"
            }
        ]
    ]
}

Code with VK API

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
bkosun, 2019-08-19
@fwervbyberstvrstrf

buttons is an array of arrays with buttons, where each new array describes a new row.
Square brackets - array
Curly brackets - object
The first three arrays contain one object each. The fourth array contains several objects (4).
https://vk.com/dev/bots_docs_3?f=4.1.+%D0%9F%D0%BE...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question