Как вызвать команду /reg через inline клавиатуру aiogram 3.1.1

У меня есть inline клавиатура

start_reg = types.InlineKeyboardMarkup(row_width=1,
                                   inline_keyboard=[
                                       [types.InlineKeyboardButton(text='регистрация', callback_data='/reg')]
                                   ])

есть стейт

class Form(StatesGroup):
    name_profile= State()
    hero_сlass= State()
    sex = State()

после вызова /reg начинается заполнение стейта

router = Router()

@router.message(Command("reg"))
async def fill_profile(message: Message, state: FSMContext):
    await state.set_state(Form.name_profile)
    await message.answer('Как будет называться персонаж?')

@router.message(Form.name_profile)
async def dota_profile_inf(message: Message, state: FSMContext):
    await state.update_data(Имя=message.text)
    await message.answer('Какой класс у персонажа?')
    await state.set_state(Form.hero_class)

@router.message(Form.hero_class)
async def dota_profile_inf(message: Message, state: FSMContext):
    await state.update_data(Класс=message.text)
    await message.answer('Какой пол у персонажа?')
    await state.set_state(Form.sex)

@router.message(Form.sex)
async def dota_profile_inf(message: Message, state: FSMContext):
    await state.update_data(Пол=message.text)    
    await message.answer('регистрация завершена')
    data = await state.get_data()
    await state.clear()
    formated_txt = []
    [
        formated_txt.append(f'{key}: {value}')
        for key, value in data.items()
    ]
    formated_str = "\n".join(formated_txt)
    await message.answer(formated_str)

как сделать так чтобы при нажатии кнопки start_reg вызывалась команда /reg после которой будет запущена форма

p.s. простите за странные формулировки я ваще не понимаю как это сказать словами


Ответы (0 шт):