Пример #1
0
async def notes(call: CallbackQuery, state: FSMContext):
    await call.answer(cache_time=5)
    await call.message.answer("Напишите заметку:")
    text = call.message.text
    id = tasks.find_task(text)
    await state.update_data(id=id)
    await NotesStates.add.set()
Пример #2
0
async def remind(call: CallbackQuery, state: FSMContext):
    await call.answer(cache_time=5)
    await call.message.answer("Добавить напоминание\n"
                              "Введите в формате: 2020-11-28 03:01")
    text = call.message.text
    id = tasks.find_task(text)
    await state.update_data(id=id)
    await RemindStates.add.set()
Пример #3
0
async def add_tooday(call: CallbackQuery):
    await call.answer(cache_time=5)
    text = call.message.text
    id = tasks.find_task(text)
    param = 0
    db.edit_today(id, param)
    post = db.find_task(id)
    msg = tasks.format_task(post)
    await call.message.edit_text(msg, reply_markup=task_button)
Пример #4
0
async def eisenhower_keyboard(call: CallbackQuery):
    await call.answer(cache_time=5)
    text = call.message.text
    id = tasks.find_task(text)
    time = tasks.get_now_formatted()
    db.edit_done(id, time)
    post = db.find_task(id)

    await call.message.delete()
Пример #5
0
async def eisenhower_keyboard(call: CallbackQuery):
    await call.answer(cache_time=5)
    text = call.message.text
    id = tasks.find_task(text)
    tags = "Неважное Несрочное"
    db.edit_tags(id, tags)
    post = db.find_task(id)
    if post['today'] == 1:
        keyboard = today_button
    else:
        keyboard = task_button
    msg = tasks.format_task(post)
    await call.message.edit_text(msg, reply_markup=keyboard)