PaulSonOfLars / gotgbot

Autogenerated Go wrapper for the telegram API. Inspired by the python-telegram-bot library.
MIT License
442 stars 105 forks source link

InlineKeyboardRow #169

Closed svscorp closed 3 weeks ago

svscorp commented 3 weeks ago

Hi Paul,

I am wondering, how do you implement ReplyMarkup that has buttons not in a row, but under each other?

The below code places then one after another in a row.

InlineKeyboard: [][]gotgbot.InlineKeyboardButton{{
                {Text: "btn1", CallbackData: "data1"},
                {Text: "btn2", CallbackData: "data2"},
                {Text: "btn3", CallbackData: "data3"},
            }},

I am trying to find is there something like InlineKeyboardRow?

PaulSonOfLars commented 3 weeks ago

InlineKeyboard is a 2D array; first is the rows, second is the columns. Your example above is only adding to the columns. If you want more rows, move that up to the parent array. Does that make sense?

svscorp commented 3 weeks ago

Makes sense, let me try that. I thought so it’s 2D array as it’s defined. Somehow overlooked. Sorry for the noise then - will self-close the issue after the check :)

svscorp commented 3 weeks ago

All good. Thanks @PaulSonOfLars !