после запуска это часть кода не работает "@router.message(Command("Заполнить анкету"))", ни какой ошибки не выдает.
from aiogram.fsm.state import State, StatesGroup
from aiogram.fsm.context import FSMContext
from aiogram.enums.parse_mode import ParseMode
from aiogram.fsm.storage.memory import MemoryStorage
from aiogram.filters import CommandStart, Command
from aiogram.types import Message, CallbackQuery
from aiogram import Router, types
import keyboards as kb
router = Router()
@router.message(CommandStart())
async def cmd_start(message:Message):
await message.answer(f"Привет", reply_markup=kb.main)
class Reg(StatesGroup):
first_name = State()
last_name = State()
middle_name= State()
@router.message(Command("Заполнить анкету"))
async def reg_one(message: types.Message, state: FSMContext):
await state.set_state(Reg.first_name)
await message.answer("first_name:")
@router.message(Reg.first_name)
async def reg_two(message: types.Message, state: FSMContext):
await state.update_data(first_name=message.text)
await state.set_state(Reg.last_name)
await message.answer("last_name:")
@router.message(Reg.last_name)
async def reg_three(message: types.Message, state: FSMContext):
await state.update_data(last_name=message.text)
await state.set_state(Reg.middle_name)
await message.answer("middle_name:")
@router.message(Reg.middle_name)
async def reg_four(message: types.Message, state: FSMContext):
await state.update_data(middle_name=message.text)
data = await state.get_data()
await message.answer(
f"Спасибо.\n"
f"Имя {data['first_name']}\n"
f"Фамилия: {data['last_name']}\n"
f"Отчество: {data['middle_name']}"
)
await state.clear()