mirror of https://github.com/stijndcl/didier
Fix error in food
parent
cdb8a04cde
commit
cbe1cf747f
|
@ -29,6 +29,7 @@ class School(commands.Cog):
|
||||||
menu = eten.etenScript(day)
|
menu = eten.etenScript(day)
|
||||||
embed = discord.Embed(colour=discord.Colour.blue())
|
embed = discord.Embed(colour=discord.Colour.blue())
|
||||||
embed.set_author(name="Menu voor {}".format(day))
|
embed.set_author(name="Menu voor {}".format(day))
|
||||||
|
|
||||||
if "gesloten" in menu[0].lower():
|
if "gesloten" in menu[0].lower():
|
||||||
embed.description = "Restaurant gesloten"
|
embed.description = "Restaurant gesloten"
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -26,7 +26,11 @@ def etenScript(weekDag):
|
||||||
|
|
||||||
# Fetch from API
|
# Fetch from API
|
||||||
try:
|
try:
|
||||||
menu = requests.get("https://zeus.ugent.be/hydra/api/2.0/resto/menu/nl-sterre/{}/{}/{}.json".format(d.year, d.month, d.day)).json()
|
menu = requests.get(f"https://zeus.ugent.be/hydra/api/2.0/resto/menu/nl-sterre/{d.year}/{d.month}/{d.day}.json").json()
|
||||||
|
|
||||||
|
if not menu["meals"]:
|
||||||
|
raise Exception()
|
||||||
|
|
||||||
# Print menu
|
# Print menu
|
||||||
|
|
||||||
for s in menu["meals"]:
|
for s in menu["meals"]:
|
||||||
|
@ -49,4 +53,4 @@ def etenScript(weekDag):
|
||||||
menuSoep += "Restaurant gesloten"
|
menuSoep += "Restaurant gesloten"
|
||||||
menuGroenten += "Restaurant gesloten"
|
menuGroenten += "Restaurant gesloten"
|
||||||
menuHoofdgerechten += "Restaurant gesloten"
|
menuHoofdgerechten += "Restaurant gesloten"
|
||||||
return (menuSoep, menuHoofdgerechten, menuGroenten)
|
return menuSoep, menuHoofdgerechten, menuGroenten
|
||||||
|
|
Loading…
Reference in New Issue