A
A
Asriel2021-06-09 15:51:08
Python
Asriel, 2021-06-09 15:51:08

How to hide the keyboard in a bot?

Hello. I want to hide the regular keyboard after pressing it. I know how to do it, but in my case I don't. The fact is that when you click on the button, a message appears with an inline keyboard, so simply writing reply_markup=none will not work, since an inline keyboard is needed, but the usual keyboard is not hidden. How to do it?

if message.text == 'Текст': #текст обычной не инлайн кнопки
  keyboard = types.InlineKeyboardMarkup(row_width=3)
  nine = types.InlineKeyboardButton('⬅️Назад', callback_data='nine')
  close = types.InlineKeyboardButton('↩️Скасувати', callback_data='close')
  two = types.InlineKeyboardButton('➡️Вперед', callback_data='two')
  keyboard.add(nine, close, two)
  bot.send_photo(message.chat.id, '<file_id>', caption = 'Текст.', reply_markup=keyboard)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
soremix, 2021-06-09
@SoreMix

In one message, send a photo with an inline keyboard, and in the next message, delete the usual one. Or immediately make the reply keyboard disposable throughReplyKeyboardMarkup(one_time_keyboard=True)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question