platform integration
This commit is contained in:
@@ -94,12 +94,12 @@ class Answer:
|
||||
if len(lessons) == 0:
|
||||
self.send_message(
|
||||
"Сегодня у тебя нет пар, отдыхай",
|
||||
reply_markup=main_keyboard()
|
||||
reply_markup=main_keyboard(self.user['chat_id'])
|
||||
)
|
||||
else:
|
||||
self.send_message(
|
||||
"Твои пары сегодня:\n" + ruz.schedule_builder(lessons),
|
||||
reply_markup=main_keyboard(),
|
||||
reply_markup=main_keyboard(self.user['chat_id']),
|
||||
parse_mode='Markdown',
|
||||
)
|
||||
self.set_state("ready")
|
||||
@@ -150,7 +150,7 @@ class Answer:
|
||||
text = "Я не понимаю такой команды, используй кнопки."
|
||||
self.send_message(
|
||||
text,
|
||||
reply_markup=main_keyboard(),
|
||||
reply_markup=main_keyboard(self.user['chat_id']),
|
||||
parse_mode='Markdown'
|
||||
)
|
||||
|
||||
@@ -171,7 +171,7 @@ class Answer:
|
||||
self.set_state("ready")
|
||||
self.send_message(
|
||||
self.message_text,
|
||||
reply_markup=main_keyboard()
|
||||
reply_markup=main_keyboard(self.user['chat_id'])
|
||||
)
|
||||
else:
|
||||
self.send_message("Используй кнопки!", reply_markup=notify_type())
|
||||
@@ -192,7 +192,7 @@ class Answer:
|
||||
return
|
||||
mongo.users_collection.update_one({"chat_id": self.user['chat_id']}, {"$set": {"first_lesson_notify": time_notify}})
|
||||
self.set_state("ready")
|
||||
self.send_message("Запомнил!", reply_markup=main_keyboard())
|
||||
self.send_message("Запомнил!", reply_markup=main_keyboard(self.user['chat_id']))
|
||||
|
||||
def handle_state_wait_for_daily_notify_type(self):
|
||||
if self.message_text == "Текущий день":
|
||||
@@ -216,7 +216,7 @@ class Answer:
|
||||
elif self.message_text == "Не уведомлять":
|
||||
self.send_message(
|
||||
"Принято! Я не буду уведомлять тебя.",
|
||||
reply_markup=main_keyboard()
|
||||
reply_markup=main_keyboard(self.user['chat_id'])
|
||||
)
|
||||
mongo.users_collection.update_one(
|
||||
{"chat_id": self.user['chat_id']},
|
||||
@@ -225,7 +225,7 @@ class Answer:
|
||||
elif self.message_text == "Назад":
|
||||
self.send_message(
|
||||
"Возвращаюсь!",
|
||||
reply_markup=main_keyboard()
|
||||
reply_markup=main_keyboard(self.user['chat_id'])
|
||||
)
|
||||
mongo.users_collection.update_one(
|
||||
{"chat_id": self.user['chat_id']},
|
||||
@@ -259,7 +259,7 @@ class Answer:
|
||||
text = f"Принято! Буду уведомлять тебя за {self.message_text}."
|
||||
else:
|
||||
text = f"Принято! Я не буду уведомлять тебя."
|
||||
self.send_message(text, reply_markup=main_keyboard())
|
||||
self.send_message(text, reply_markup=main_keyboard(self.user['chat_id']))
|
||||
self.set_state("ready")
|
||||
|
||||
def _validate_time(self, line: str) -> bool:
|
||||
@@ -281,7 +281,7 @@ class Answer:
|
||||
if self.message_text == "Не уведомлять":
|
||||
self.send_message(
|
||||
"Принято! Я не буду присылать тебе ежедневные уведомления.",
|
||||
reply_markup=main_keyboard()
|
||||
reply_markup=main_keyboard(self.user['chat_id'])
|
||||
)
|
||||
mongo.users_collection.update_one(
|
||||
{"chat_id": self.user['chat_id']},
|
||||
@@ -298,7 +298,7 @@ class Answer:
|
||||
next_time = get_next_daily_notify_time(self.user)
|
||||
self.send_message(
|
||||
f"Принято! Буду уведомлять тебя каждый день в {self.message_text}.",
|
||||
reply_markup=main_keyboard()
|
||||
reply_markup=main_keyboard(self.user['chat_id'])
|
||||
)
|
||||
mongo.users_collection.update_one(
|
||||
{"chat_id": self.user['chat_id']},
|
||||
@@ -314,7 +314,7 @@ class Answer:
|
||||
mongo.users_collection.delete_one({"email": self.user['email']})
|
||||
self.send_message("Настройки сброшены, ждем твоего возвращения", reply_markup=again_keyboard())
|
||||
elif self.message_text == "Нет":
|
||||
self.send_message("Возращаюсь к прежнему режиму", reply_markup=main_keyboard())
|
||||
self.send_message("Возращаюсь к прежнему режиму", reply_markup=main_keyboard(self.user['chat_id']))
|
||||
self.set_state("ready")
|
||||
else:
|
||||
self.send_message("Я не понимаю, используй кнопки", reply_markup=yes_no_keyboard())
|
||||
|
||||
Reference in New Issue
Block a user