S
S
SHADRIN2020-06-04 07:50:58
Python
SHADRIN, 2020-06-04 07:50:58

How to set up ReplyKeyboard in Telegram?

I can’t make several buttons in 3 columns for some reason it doesn’t work, tell me what I looked at.

keyboard = types.ReplyKeyboardMarkup(row_width=3, one_time_keyboard=True, resize_keyboard=True)
            keyboard.add(*[types.KeyboardButton(name) for name in['Одежда']])
            keyboard.add(*[types.KeyboardButton(name) for name in['Обувь']])
            keyboard.add(*[types.KeyboardButton(name) for name in['Сумки']])
            keyboard.add(*[types.KeyboardButton(name) for name in['Часы']])
            keyboard.add(*[types.KeyboardButton(name) for name in['Парфюм']])
            keyboard.add(*[types.KeyboardButton(name) for name in['Очки']])
            keyboard.add(*[types.KeyboardButton(name) for name in['Бижутерия']])
            keyboard.add(*[types.KeyboardButton(name) for name in['Чат с оператором']])
            keyboard.add(*[types.KeyboardButton(name) for name in['FAQ']])
            bot.send_message(message.chat.id, 'Выберите тип товара', reply_markup=keyboard, parse_mode="Html")

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vespiary, 2020-06-13
@xstesla


keyboard = types.ReplyKeyboardMarkup(one_time_keyboard=True, resize_keyboard=True)
clothes = types.KeyboardButton(text = 'Clothes')
snikers = types.KeyboardButton(text = 'Shoes')
bags = types.KeyboardButton(text = 'Bags')
keyboard.add(clothes, snikers, bags)
bot.send_message(message.chat.id, 'Select item type', reply_markup=keyboard, parse_mode="Html")

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question