Empty deadlines, fix error, add easter egg

pull/102/head
Stijn De Clercq 2021-12-26 00:30:14 +01:00
parent c154a4bb2a
commit f5e62a0fb9
2 changed files with 10 additions and 39 deletions

View File

@ -47,10 +47,6 @@ class Deadlines:
now = time.time() now = time.time()
if not self.data:
embed.description = "Er staan geen deadlines gepland."
return embed
courses: Dict courses: Dict
for year, courses in sorted(self.data.items(), key=lambda x: x[0]): for year, courses in sorted(self.data.items(), key=lambda x: x[0]):
content = [] content = []
@ -61,8 +57,14 @@ class Deadlines:
content.append(Deadline(course, deadline, t, t < now)) content.append(Deadline(course, deadline, t, t < now))
content.sort(key=lambda x: x.t) content.sort(key=lambda x: x.t)
content = map(lambda x: str(x), content) content = list(map(lambda x: str(x), content))
if content:
embed.add_field(name=get_edu_year(int(year)), value="\n".join(content), inline=False) embed.add_field(name=get_edu_year(int(year)), value="\n".join(content), inline=False)
# No deadlines planned
if not embed.fields:
embed.description = "Er staan geen deadlines gepland."
embed.set_image(url="https://c.tenor.com/RUzJ3lDGQUsAAAAC/iron-man-you-can-rest-now.gif")
return embed return embed

View File

@ -1,35 +1,4 @@
{ {
"2": { "2": {},
"StatProb": { "3": {}
"Project": 1639090740
},
"AD2": {
"Project": 1638738000
},
"FuncProg": {
"Project 3": 1640104200
}
},
"3": {
"AD3": {
"Project (code)": 1638967062,
"Project (verslag)": 1639571862
},
"AI": {
"Presentatie project": 1639870920,
"Verslag": 1640386799
},
"BestSys": {
"Linux pract 2": 1638402120,
"Linux pract 3": 1639006920
},
"Modsim": {
"Project": 1640386799
},
"Telecom": {
"Keuze artikel": 1638745140,
"Presentaties 1": 1639990800,
"Presentaties 2": 1640088000
}
}
} }