Fix jimmy

This commit is contained in:
nex 2022-10-30 16:21:35 +00:00
parent 4792b53e0d
commit 1d63dd42aa

View file

@ -98,10 +98,10 @@ class TimeTableCog(commands.Cog):
# Loop until we find the next day when it isn't the weekend, and we aren't on break.
next_available_date = date.replace(hour=0, minute=0, second=0)
print("[absolute next lesson] next available date: ", next_available_date)
while self.are_on_break(next_available_date) or not self.timetable.get(date.strftime("%A").lower()):
while self.are_on_break(next_available_date) or not self.timetable.get(date.strftime("%a").lower()):
print("[absolute next lesson] Next available date is on break? ",
bool(self.are_on_break(next_available_date)))
print("[absolute next lesson] Is timetabled date?", self.timetable.get(date.strftime("%A").lower()))
print("[absolute next lesson] Is timetabled date?", self.timetable.get(date.strftime("%a").lower()))
next_available_date += timedelta(days=1)
if next_available_date.year >= 2024:
raise RuntimeError("Failed to fetch absolute next lesson")