Compare commits

...

3 Commits

Author SHA1 Message Date
Stijn De Clercq 5703ee6fcf
Merge pull request #50 from stijndcl/enable_les
Enable les again
2021-04-18 23:26:39 +02:00
Stijn De Clercq 8e51364268 Change comparch schedule 2021-04-18 23:26:05 +02:00
Stijn De Clercq d240c3c50f Enable les again 2021-04-18 23:24:46 +02:00
4 changed files with 19 additions and 22 deletions

View File

@ -45,25 +45,21 @@ class School(commands.Cog):
# @commands.check(checks.allowedChannels) # @commands.check(checks.allowedChannels)
@help.Category(category=Category.School) @help.Category(category=Category.School)
async def les(self, ctx, *day): async def les(self, ctx, *day):
deadlines = ["SEL", "Webdevelopment", "Computerarchitectuur", "Wetenschappelijk Rekenen"] parsed = les.parseArgs(day)
await ctx.send("'T is vakantie. Sort of. Werk een beetje aan uw project voor {}.".format(random.choice(deadlines))) # Invalid arguments
# if not parsed[0]:
# parsed = les.parseArgs(day) return await ctx.send(parsed[1])
#
# # Invalid arguments day, dayDatetime, semester, year = parsed[1:]
# if not parsed[0]:
# return await ctx.send(parsed[1]) # Customize the user's schedule
# schedule = self.customizeSchedule(ctx, year, semester)
# day, dayDatetime, semester, year = parsed[1:]
# # Create the embed
# # Customize the user's schedule embed = les.createEmbed(day, dayDatetime, semester, year, schedule)
# schedule = self.customizeSchedule(ctx, year, semester)
# await ctx.send(embed=embed)
# # Create the embed
# embed = les.createEmbed(day, dayDatetime, semester, year, schedule)
#
# await ctx.send(embed=embed)
# Add all the user's courses # Add all the user's courses
def customizeSchedule(self, ctx, year, semester): def customizeSchedule(self, ctx, year, semester):

View File

@ -12,7 +12,7 @@ class Reminders:
self._les = [int(user[0]) for user in rows if user[2]] self._les = [int(user[0]) for user in rows if user[2]]
self._lesMessages = ["Lessenrooster voor vandaag:"] self._lesMessages = ["Lessenrooster voor vandaag:"]
self.les = {"users": self._les, "messages": self._lesMessages, "embed": self.lesEmbed(), "weekends": False, "disabled": True} self.les = {"users": self._les, "messages": self._lesMessages, "embed": self.lesEmbed(), "weekends": False, "disabled": False}
self.categories = [self.nightly, self.les] self.categories = [self.nightly, self.les]

View File

@ -5,7 +5,7 @@
"msteams": "https://teams.microsoft.com/l/team/19%3ad7295f0bc4634a61b461504d4a7134b3%40thread.tacv2/conversations?groupId=8755cb96-1ef5-4ea3-b806-eeebf8a85ae8&tenantId=d7811cde-ecef-496c-8f91-a1786241b99c", "msteams": "https://teams.microsoft.com/l/team/19%3ad7295f0bc4634a61b461504d4a7134b3%40thread.tacv2/conversations?groupId=8755cb96-1ef5-4ea3-b806-eeebf8a85ae8&tenantId=d7811cde-ecef-496c-8f91-a1786241b99c",
"slots": [ "slots": [
{ {
"online": "ZOOM", "online": "MS Teams",
"time": ["maandag", 1000, 1300] "time": ["maandag", 1000, 1300]
}, },
{ {

View File

@ -24,13 +24,14 @@ def createEmbed(day, dayDatetime, semester, year, schedule):
startDate = 1612224000 startDate = 1612224000
currentTime = dayDatetime.timestamp() currentTime = dayDatetime.timestamp()
# TODO don't clamp because week 1 is calculated as week 0!!
week = clamp(timeFormatters.timeIn(currentTime - startDate, "weeks")[0], 1, 13) week = clamp(timeFormatters.timeIn(currentTime - startDate, "weeks")[0], 1, 13)
# Compensate for easter holidays # Compensate for easter holidays
# Sorry but I don't have time to make a clean solution for this rn # Sorry but I don't have time to make a clean solution for this rn
# this will have to do # this will have to do
if currentTime > 1617377400: # Does -1 instead of -2 because weeks were 0-indexed all along
week -= 2 week -= 1
title, week = getTitle(day, dayDatetime, week) title, week = getTitle(day, dayDatetime, week)