Здравствуйте помогите с календарём aiogram

class UserState(StatesGroup):
name = State()
check_in = State()
check_out = State()
hotel = State()
price = State()
distance = State()


@dp.message_handler(commands=['start'])
async def start(message: Message):
    await message.answer('Введите название города')
    await UserState.name.set()

@dp.message_handler(state=UserState.name)
async def get_address(message: types.Message, state: FSMContext):
    await message.answer('Укажите точную локацию')

    await UserState.check_in.set()



@dp.message_handler(state=UserState.check_in)
async def check_in(message: Message, state: FSMContext):
    await message.answer('Укажите дату заезда')
    date = datetime.date.today()
    calendar, step = DetailedTelegramCalendar(calendar_id=1, locale='ru', min_date=date).build()
    await message.answer(f'Выберите {LSTEP[step]}', reply_markup=calendar)


@dp.callback_query_handler(DetailedTelegramCalendar.func(calendar_id=1))
async def calendar_check_in(call_query: CallbackQuery):
    date = datetime.date.today()
    result, key, step = DetailedTelegramCalendar(calendar_id=1, locale='ru', min_date=date).process(call_query.data)
    if not result and key:
        await call_query.message.edit_text(f"Выберите {LSTEP[step]}", reply_markup=key)
    elif result:
        await call_query.message.edit_text(f"Дата заезда  {result}")
        set_date_input(chat_id=call_query.message.chat.id, date_in=str(result))
        check_out(call_query.message.chat.id)

У меня переходит к функции календаря но не работает как мне сделать так чтобы работало помогите пожалуйста за ранее спасибо!


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