Можно подогнать к моему боту кнопку отмены вместо команды

@dp.message_handler(state="*", commands='Назад')
#@dp.message_handler(text(equals='Назад', ignore_case=True), state='*')
async def cancel_handler(message: types.Message, state: FSMContext):
    current_state = await state.get_state()
    if current_state is None:
        return
    await state.finish()
    await message.reply('Cancelled.', reply_markup=types.ReplyKeyboardRemove())
    photo=open(f'.uploads/rp.png', 'rb')
    await message.answer_photo(photo, f'{bot.rules}', reply_markup=keyboard, parse_mode='HTML')
Back to Top