1

Looking for json payload to create inline_keyboard with multiple InlineKeyboardButton on the same row.

The following code is working but creates 1 button per row.

{
  "telegram": {
    "text": "Pick a color",
    "reply_markup": {
      "inline_keyboard": [
        [
          {
            "text": "Red",
            "callback_data": "Red"
          }
        ],        
        [
          {
            "text": "Pink",
            "callback_data": "Pink"
          }
        ]
      ]
    }
  }
}

Telegram Card in Dialogflow is able to create multiple inline buttons similar to as shown below:

inline_keyboard with inline buttons

https://core.telegram.org/file/811140217/1/NkRCCLeQZVc/17a804837802700ea4

barbsan
  • 3,418
  • 11
  • 21
  • 28
vltech
  • 13
  • 1
  • 3

1 Answers1

2

inline_keyboard consists of rows, each row consists of buttons.

So just add buttons to the first row (Blue and Green in this case) like this:

{
  "telegram": {
    "text": "Pick a color",
    "reply_markup": {
      "inline_keyboard": [
        [
          {
            "text": "Red",
            "callback_data": "Red"
          },
          {
            "text": "Blue",
            "callback_data": "Blue"
          },
          {
            "text": "Green",
            "callback_data": "Green"
          }
        ]
      ]
    }
  }
}
Ivan Vinogradov
  • 4,269
  • 6
  • 29
  • 39