Сама ошибка при вводе команды) aiogram.utils.exceptions.BadRequest: Can't parse inline keyboard button: can't find field "text"
Код
@dp.callback_query_handler(lambda c: c.data and c.data.startswith ('btn'))
async def process_callback_kb1btn1(callback_query: types.CallbackQuery):
code = callback_query.data[-1]
if code.isdigit():
code = int(code)
if code == 2:
await bot.answer_callback_query(callback_query.id, text='Нажата вторая кнопка')
elif code == 5:
await bot.answer_callback_query(
callback_query.id,
text="Нажата кнопка с номером 5", show_alert=True)
else:
await bot.answer_callback_query(callback_query.id)
await bot.send_message(callback_query.from_user.id, f'Нажата инлайн кнопка! code={code}')
@dp.message_handler(commands=['2'])
async def process_command_2(message: types.Message):
await message.reply("Отправляю все возможные кнопки", reply_markup=kb_client)