I am struggling with getting my aiogram bot to work. Please note that I am new to aiogram, so I'm sorry if you find my question silly. I want to be able to write state and then read it in callback. Imagine a TODO bot, where it gets you the list of TODO's and then there is buttons like Task1, Task2, Task3, PrevPage and NextPage. I want to be able to send this message with InlineKeyboardMarkup, freely change pages, and when the user clicks on one of the task buttons, send him this task specifically and give the opportunity to edit it by copying, changing and resending it to the bot. How can I do this?
Currently my code is:
@router.callback_query(F.data == 'task-1')
async def task1(callback: CallbackQuery, state: FSMContext):
# some stuff
For message:
@router.message(F.text == 'View tasks')
async def tasks(message: Message, state: FSMContext):
await state.set_state(st.TaskState.page)
The issue here that I cannot filter callbacks by state.