From 6ddaa6e488d530e089cf3133b7a91723dcc4b21a Mon Sep 17 00:00:00 2001 From: Stijn De Clercq Date: Mon, 9 Aug 2021 00:40:15 +0200 Subject: [PATCH] Fix les embed reminder --- data/remind.py | 11 +++++------ functions/les.py | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/data/remind.py b/data/remind.py index bfe4768..403fb37 100644 --- a/data/remind.py +++ b/data/remind.py @@ -1,4 +1,5 @@ -from functions import les +from data import schedule +from functions import les, config from functions.database import remind @@ -17,8 +18,6 @@ class Reminders: self.categories = [self.nightly, self.les] def lesEmbed(self): - day, dayDatetime, semester, year = les.parseArgs([])[1:] - - schedule = les.getSchedule(semester, year) - - return les.createEmbed(day, dayDatetime, semester, year, schedule) \ No newline at end of file + dt = les.find_target_date() + s = schedule.Schedule(dt, int(config.get("year")), int(config.get("semester"))) + return s.create_schedule().to_embed() diff --git a/functions/les.py b/functions/les.py index c3a7cfb..628a155 100644 --- a/functions/les.py +++ b/functions/les.py @@ -3,7 +3,7 @@ from functions.timeFormatters import dateTimeNow, weekdayToInt, forward_to_weekd from typing import Optional -def find_target_date(arg: Optional[str]) -> datetime: +def find_target_date(arg: Optional[str] = None) -> datetime: """ Find the requested date out of the user's arguments """