From 85f29e7afad56f477650fcdee16a0c9e431e292f Mon Sep 17 00:00:00 2001 From: Stijn De Clercq Date: Sun, 8 Aug 2021 19:32:41 +0200 Subject: [PATCH] Check for semester end --- cogs/school.py | 4 ++++ files/schedules/31.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cogs/school.py b/cogs/school.py index b22482d..8f52d6e 100644 --- a/cogs/school.py +++ b/cogs/school.py @@ -54,6 +54,10 @@ class School(commands.Cog): date = skip_weekends(date) s = schedule.Schedule(date, int(config.get("year")), int(config.get("semester")), day is not None) + + if s.semester_over: + return await ctx.send("Het semester is afgelopen.") + return await ctx.send(embed=s.create_schedule().to_embed()) @commands.command(name="Pin", usage="[Message]") diff --git a/files/schedules/31.json b/files/schedules/31.json index f40f33d..8edbf90 100644 --- a/files/schedules/31.json +++ b/files/schedules/31.json @@ -1,6 +1,6 @@ { "semester_start": [1, 7, 2021], - "semester_end": [16, 8, 2021], + "semester_end": [1, 8, 2021], "holidays": [ { "start_date": [2, 7, 2021, 23, 59, 59],