mirror of https://github.com/stijndcl/didier
				
				
				
			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
							parent
							
								
									f77e465076
								
							
						
					
					
						commit
						68405963eb
					
				|  | @ -63,7 +63,13 @@ class School(commands.Cog): | ||||||
|     def customizeSchedule(self, ctx, year, semester): |     def customizeSchedule(self, ctx, year, semester): | ||||||
|         schedule = les.getSchedule(semester, year) |         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 role in member.roles: | ||||||
|             for univYear in years: |             for univYear in years: | ||||||
|                 for course in univYear: |                 for course in univYear: | ||||||
|  |  | ||||||
|  | @ -58,17 +58,49 @@ | ||||||
|     "slots": [ |     "slots": [ | ||||||
|       { |       { | ||||||
|         "online": "Bongo Virtual Classroom", |         "online": "Bongo Virtual Classroom", | ||||||
|  |         "campus": "Sterre", | ||||||
|  |         "building": "S9", | ||||||
|  |         "room": "A3", | ||||||
|         "time": ["dinsdag", 1300, 1400] |         "time": ["dinsdag", 1300, 1400] | ||||||
|       }, |       }, | ||||||
|       { |       { | ||||||
|         "online": "ZOOM", |         "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", |         "online": "Bongo Virtual Classroom", | ||||||
|         "time": ["vrijdag", 830, 930] |         "time": ["vrijdag", 830, 930] | ||||||
|       }, |       }, | ||||||
|       { |       { | ||||||
|  |         "weeks": [6, 7, 8, 9, 10, 11, 12], | ||||||
|         "online": "MS Teams", |         "online": "MS Teams", | ||||||
|         "time": ["vrijdag", 1000, 1100] |         "time": ["vrijdag", 1000, 1100] | ||||||
|       } |       } | ||||||
|  | @ -80,32 +112,27 @@ | ||||||
|     "slots": [ |     "slots": [ | ||||||
|       { |       { | ||||||
|         "online": "ZOOM", |         "online": "ZOOM", | ||||||
|         "time": ["woensdag", 1100, 1200] |         "campus": "Ardoyen", | ||||||
|  |         "building": "Locus", | ||||||
|  |         "room": "Resto Locus", | ||||||
|  |         "time": ["woensdag", 1000, 1230] | ||||||
|       }, |       }, | ||||||
|       { |       { | ||||||
|         "online": "ZOOM", |         "online": "ZOOM", | ||||||
|         "time": ["woensdag", 1430, 1600] |  | ||||||
|       }, |  | ||||||
|       { |  | ||||||
|         "weeks": [4, 7], |  | ||||||
|         "locations": [ |  | ||||||
|           { |  | ||||||
|         "campus": "Ardoyen", |         "campus": "Ardoyen", | ||||||
|             "building": "iGent", |         "building": "Locus", | ||||||
|             "room": "0.1" |         "room": "Resto Locus", | ||||||
|           }, |  | ||||||
|           { |  | ||||||
|             "campus": "Ardoyen", |  | ||||||
|             "building": "iGent", |  | ||||||
|             "room": "0.1 PRA" |  | ||||||
|           }, |  | ||||||
|           { |  | ||||||
|             "campus": "Ardoyen", |  | ||||||
|             "building": "iGent", |  | ||||||
|             "room": "0.2" |  | ||||||
|           } |  | ||||||
|         ], |  | ||||||
|         "time": ["woensdag", 1430, 1700] |         "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] | ||||||
|       } |       } | ||||||
|     ] |     ] | ||||||
|   }, |   }, | ||||||
|  |  | ||||||
|  | @ -186,7 +186,7 @@ def getExtras(extra): | ||||||
|             start, end |             start, end | ||||||
|         ) |         ) | ||||||
|     elif "online" in extra["slot"]: |     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:], |             extra["course"], location[7:], | ||||||
|             start, end |             start, end | ||||||
|         ) |         ) | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue