aiogram_calendar icon indicating copy to clipboard operation
aiogram_calendar copied to clipboard

Qu in using

Open djskeletik opened this issue 3 years ago • 4 comments

Hello! About 2 days ago I've tried to use dialog calendar. Like that:

@dp.message_handler(state=Wallet.Graph_state)
async def painting_Graph(message: Message):
    currency = message.text
    await message.answer("Please select a date: ", reply_markup=await DialogCalendar().start_calendar())

@dp.callback_query_handler(dialog_cal_callback.filter())
async def process_dialog_calendar(callback_query: CallbackQuery, callback_data: dict):
    selected, date = await DialogCalendar().process_selection(callback_query, callback_data)
    if selected:
        await callback_query.message.answer(
        f'You selected {date.strftime("%d/%m/%Y")}', reply_markup=markup)

Can I use it in state machine or it incompatible with it?

djskeletik avatar Aug 24 '22 10:08 djskeletik

@djskeletik, this help you https://ru.stackoverflow.com/questions/1398006/Проблема-с-aiogram-calendar-и-fsm

lev007-ops avatar Aug 29 '22 12:08 lev007-ops

@djskeletik in your example you are using state only in message_handler which suppose to show inline keyboard. So at this point its not related to calendar yet. Can you explain what is not working? Calendar provides keyboards & a series of callbacks. Overall it depends on your FSM use

noXplode avatar Aug 31 '22 20:08 noXplode

@noXplode The problem is that when I started the calendar with the State, the callback_query_handler did not accept input on the calendar, but if I reset the state before starting the calendar (without deleting the information in the state), it worked. So now it works.) Thanks for help @lev007-ops

djskeletik avatar Aug 31 '22 21:08 djskeletik

thanks, I already figured it out, yesterday I wanted to delete it, but somehow my hands did not reach)

Пн, 29 авг. 2022 г. в 15:21, Levman5 @.***>:

@djskeletik https://github.com/djskeletik, this help you https://ru.stackoverflow.com/questions/1398006/Проблема-с-aiogram-calendar-и-fsm

— Reply to this email directly, view it on GitHub https://github.com/noXplode/aiogram_calendar/issues/4#issuecomment-1230212135, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATAOIC7ZBYNOHO2D5NCLPW3V3STOJANCNFSM57OXQ5PQ . You are receiving this because you were mentioned.Message ID: @.***>

djskeletik avatar Oct 11 '22 08:10 djskeletik