M
M
Moroz228482019-08-29 23:01:58
Python
Moroz22848, 2019-08-29 23:01:58

How to make a second line for bot buttons in VK in JSON?

I get an error "keyboard format is invalid: row 0 contains too many
columns " : [ [{ "action": { "type": "text", "label": "Profile" }, "color": "positive" }, { "action": { "type": "text", " label": "Shop" }, "color": "positive" }, { "action":{ "type": "text", "label": "Warehouse" }, "color": "positive"
},
{
"action": {
"type": "text",
"label": "Farm"
},
"color": "positive"
},
{
"action": {
"type": "text",
"label": " Help"
},
"color": "positive"
}]
]
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
zax2002, 2019-08-29
@Moroz22848

buttons is an array of arrays. Find the difference from your example and get the answer:

{
  "one_time": false,
  "buttons": [
    [
      {
        "action": {
          "type": "text",
          "label": "Профиль"
        },
        "color": "positive"
      },
      {
        "action": {
          "type": "text",
          "label": "Магазин"
        },
        "color": "positive"
      }
    ],
    [
      {
        "action": {
          "type": "text",
          "label": "Склад"
        },
        "color": "positive"
      },
      {
        "action": {
          "type": "text",
          "label": "Фарм"
        },
        "color": "positive"
      },
      {
        "action": {
          "type": "text",
          "label": "Помощь"
        },
        "color": "positive"
      }
    ]
  ]
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question