D
D
dmitriyprog2018-02-06 00:17:15
Python
dmitriyprog, 2018-02-06 00:17:15

How to make buttons in a row?

I want to make such an arrangement of buttons: 1 row. Only not 6, but 8 buttons I
5a78c9014e536006907885.png
increase the text of the message "in breadth" As a result, the buttons themselves are stretched, but they are not placed in a row
5a78c9843714f482688330.png
Here is my code

def choise_number_message(self, message):
        numbers, buttons = self.get_numbers()
        markup = types.InlineKeyboardMarkup()
        markup.add([types.InlineKeyboardButton(text=name, callback_data=name) for name in buttons])
        text =  'Выбери номер телефона и нажми на его цифру быммимвлщиапицвафпафп  пкуп    йуапйукфпфпотарт:\n\n' + numbers
        self.__bot.edit_message_text(text=text, chat_id=message.chat.id,
                                     message_id=message.message_id,
                                     parse_mode='HTML', reply_markup=markup)

How to do?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Oleg, 2018-02-08
@402d

Buttons are a two-dimensional array. The first level of the line. The second button in it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question