Add old schedule back in & mark covid-online classes as special classes, add a check to customizeSchedule so I don't have to patch the error every 3 minutes

pull/4/head
Stijn De Clercq 2020-10-23 23:50:37 +02:00
parent f77e465076
commit 68405963eb
3 changed files with 57 additions and 24 deletions

View File

@ -63,7 +63,13 @@ class School(commands.Cog):
def customizeSchedule(self, ctx, year, semester):
schedule = les.getSchedule(semester, year)
member = self.client.get_guild(int(constants.CallOfCode)).get_member(ctx.author.id)
COC = self.client.get_guild(int(constants.CallOfCode))
if COC is None:
return schedule
member = COC.get_member(ctx.author.id)
for role in member.roles:
for univYear in years:
for course in univYear:

View File

@ -58,17 +58,49 @@
"slots": [
{
"online": "Bongo Virtual Classroom",
"campus": "Sterre",
"building": "S9",
"room": "A3",
"time": ["dinsdag", 1300, 1400]
},
{
"online": "ZOOM",
"time": ["dinsdag", 1400, 1530]
"campus": "Sterre",
"building": "S9",
"room": "A3",
"time": ["dinsdag", 1430, 1530]
},
{
"online": "Bongo Virtual Classroom",
"campus": "Sterre",
"building": "S9",
"room": "A3",
"time": ["vrijdag", 830, 930]
},
{
"online": "MS Teams",
"campus": "Sterre",
"building": "S9",
"room": "3.1 Kondrad Zuse",
"time": ["vrijdag", 1000, 1100]
},
{
"weeks": [6, 7, 8, 9, 10, 11, 12],
"online": "Bongo Virtual Classroom",
"time": ["dinsdag", 1300, 1400]
},
{
"weeks": [6, 7, 8, 9, 10, 11, 12],
"online": "ZOOM",
"time": ["dinsdag", 1430, 1530]
},
{
"weeks": [6, 7, 8, 9, 10, 11, 12],
"online": "Bongo Virtual Classroom",
"time": ["vrijdag", 830, 930]
},
{
"weeks": [6, 7, 8, 9, 10, 11, 12],
"online": "MS Teams",
"time": ["vrijdag", 1000, 1100]
}
@ -80,32 +112,27 @@
"slots": [
{
"online": "ZOOM",
"time": ["woensdag", 1100, 1200]
"campus": "Ardoyen",
"building": "Locus",
"room": "Resto Locus",
"time": ["woensdag", 1000, 1230]
},
{
"online": "ZOOM",
"time": ["woensdag", 1430, 1600]
},
{
"weeks": [4, 7],
"locations": [
{
"campus": "Ardoyen",
"building": "iGent",
"room": "0.1"
},
{
"campus": "Ardoyen",
"building": "iGent",
"room": "0.1 PRA"
},
{
"campus": "Ardoyen",
"building": "iGent",
"room": "0.2"
}
],
"building": "Locus",
"room": "Resto Locus",
"time": ["woensdag", 1430, 1700]
},
{
"weeks": [6, 7, 8, 9, 10, 11, 12],
"online": "ZOOM",
"time": ["woensdag", 1100, 1200]
},
{
"weeks": [6, 7, 8, 9, 10, 11, 12],
"online": "ZOOM",
"time": ["woensdag", 1430, 1600]
}
]
},

View File

@ -186,7 +186,7 @@ def getExtras(extra):
start, end
)
elif "online" in extra["slot"]:
return "**{}** gaat vandaag uitzonderlijk online door {} van **{} tot {}**.".format(
return "**{}** gaat vandaag uitzonderlijk **online** door {} van **{} tot {}**.".format(
extra["course"], location[7:],
start, end
)