Browse Source

fixed day 0 bug; reformatted

pull/1/head
angerstoner 7 years ago
parent
commit
21988f52ad
  1. 7
      schneiderbot.py

7
schneiderbot.py

@ -152,10 +152,9 @@ def mensa(bot, update, args):
today += 1 today += 1
today = today % 7 today = today % 7
for arg in args: for arg in args:
if arg in MENSA_NAME: if arg in MENSA_NAME:
which = args[0]
which = arg
elif arg in MODES: elif arg in MODES:
filter_categories = MODES[arg] filter_categories = MODES[arg]
elif arg in WEEKDAYS: elif arg in WEEKDAYS:
@ -165,7 +164,9 @@ def mensa(bot, update, args):
else: else:
update.message.reply_text("Falscher Aufruf! RTFM und versuchs nochmal.") update.message.reply_text("Falscher Aufruf! RTFM und versuchs nochmal.")
return return
if today == 0:
update.message.reply_text("Sonntags hat die Mensa zu")
return
url = "https://mensa.schneider-hosting.de/static/%s.%d.json" % (MENSA_URL[which], today) url = "https://mensa.schneider-hosting.de/static/%s.%d.json" % (MENSA_URL[which], today)
request = requests.get(url) request = requests.get(url)
request.encoding = 'utf-8' request.encoding = 'utf-8'

Loading…
Cancel
Save