async def jornal(message: types.Message): id = message.from_user.id post = db.check_jornal(int(id)) await message.answer("<b>Журнал</b>\n" "______________") for msg in post: msg = tasks.format_task(msg) await message.answer(msg)
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)
async def add_task(message: types.Message): id = message.from_user.id post = db.check_task_inbox(int(id)) await message.answer("<b>ВХОДЯЩИЕ</b>\n" "______________") for msg in post: if msg["today"] == 0: msg = tasks.format_task(msg) await message.answer(msg, reply_markup=task_button) else: pass
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)
async def add_remind(message: types.Message, state: FSMContext): data = await state.get_data() id = data.get("id") remind = message.text + ":00" db.add_remind(id, remind) task = db.find_task(id) msg = tasks.format_task(task) if task['today'] == 1: keyboard = today_button else: keyboard = task_button await message.answer(msg, reply_markup=keyboard) await state.finish()
async def task_answer(message: types.Message, state: FSMContext): post = { "user_id": message.from_user.id, "task": message.text, "notes": "", "tags": "", "date_create": tasks.get_now_formatted(), "remind": "", "category": "Входящие", "today": 0, "done": 0, "done_time": "" } db.add_task(post) msg = tasks.format_task(post) await state.finish() await message.answer(msg, reply_markup=task_button)