many fixes

This commit is contained in:
Administrator
2023-04-03 00:36:41 +03:00
parent 9a9bdd8d84
commit f0440e3000
3 changed files with 35 additions and 3 deletions

View File

@@ -185,10 +185,16 @@ class Answer(BaseAnswer):
text = "Завтра у тебя нет пар, отдыхай."
else:
text = ruz.schedule_builder(lessons)
elif message.text == "Уведомления о парах":
elif message.text == "Расписание на неделю":
lessons = mongo.get_week_lessons(user)
if len(lessons) == 0:
text = "На этой неделе у тебя нет пар, отдыхай."
else:
text = ruz.schedule_builder(lessons)
elif message.text == "Напоминания о парах":
bot.send_message(
user.chat_id,
"Я умею уведомлять о каждой паре и о первой паре. Что хочешь настроить?",
"Я умею напоминать о каждой паре и о первой паре. Что хочешь настроить?",
reply_markup=notify_type()
)
self.set_state(user, "notify_type")
@@ -290,6 +296,16 @@ class Answer(BaseAnswer):
{"chat_id": user.chat_id},
{"$set": {"next_daily_notify_time": None, "daily_notify_time": None, "state": "ready"}}
)
elif text == "Назад":
bot.send_message(
user.chat_id,
"Возвращаюсь!",
reply_markup=main_keyboard()
)
mongo.users_collection.update_one(
{"chat_id": user.chat_id},
{"$set": {"next_daily_notify_time": None, "daily_notify_time": None, "state": "ready"}}
)
else:
bot.send_message(
user.chat_id,