How do you put the button back in aiogram? I don't want a button!
-
I'm writing a bot, aiogram, how it works to get back to the inline buttons. I can't understand how to do it on the usual, in the keyboard. Who's going to be able to burn... ♪ ♪ How to get out of the keyboard, too.
But that's not it.
@dp.message_handler(Text(equals='Выйти_из_клавы')) async def some_func(msg: types.Message): reply_text = "Вышли из клавы" await msg.answer(reply_text, reply_markup=types.ReplyKeyboardRemove())
-
Pressure on keyboard buttons usually means texting the button, why not make it a related group? Example:
@dp.message_handler(Text(equals='Вернуться')) async def some_func(msg: types.Message): reply_text = "Вернулись в начало" keyboard = types.ReplyKeyboardMarkup(resize_keyboard=True) keyboard.add('В меню') await msg.answer(reply_text, reply_markup=keyboard)
@dp.message_handler(Text(equals='В меню'))
async def cmd_start(message: types.Message):
keyboard = types.ReplyKeyboardMarkup(resize_keyboard=True)
keyboard.add('Вернуться')
await message.answer("Вот меню", reply_markup=keyboard)