R
R
roma671772021-01-29 19:02:33
Python
roma67177, 2021-01-29 19:02:33

How to send InlineKeyboardMarkup and ReplyKeyboardMarkup in one message? how to register 2 reply_markup?

I want that when the user presses / start, the bot sends a message with two reply_markups, that is, a message appears with buttons (InlineKeyboardMarkup) and a keyboard from below (ReplyKeyboardMarkup)

bot = telebot.TeleBot('токен')

keyboardMain = telebot.types.ReplyKeyboardMarkup(True)
keyboardMain.row('кнопка1', 'кнопка2')

paid = types.InlineKeyboardMarkup()
paid_check = types.InlineKeyboardButton(text='инлайнкнопка', callback_data='done')
paid.add(paid_check)

@bot.message_handler(commands=['start'])
def start_message(message):
  if message.text == '/start':
    bot.send_message(message.chat.id, "сообщение", parse_mode='HTML', <b>reply_markup=(keyboardMain, 'paid'))</b>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
soremix, 2021-01-29
@SoreMix

Can't do that

M
Mikhail Krostelev, 2021-01-30
@twistfire92

After sending a message with the usual keyboard buttons, they do not disappear anywhere.
So you can try this: send 2 messages. the first with a regular keyboard, with any text, the second with an inline keyboard. You can delete the first message before sending the second message.
I will not say that the method is working, I have not tried it, but if there was such a task, I would first try to do it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question