From 0c7d501501dbe9a30df5b21452465a81ec688516 Mon Sep 17 00:00:00 2001 From: kwzrd Date: Sun, 29 Mar 2020 18:04:45 +0200 Subject: Deseasonify: validate configured month override --- bot/constants.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'bot/constants.py') diff --git a/bot/constants.py b/bot/constants.py index 7a8f13e7..c739e277 100644 --- a/bot/constants.py +++ b/bot/constants.py @@ -151,6 +151,12 @@ class Month(enum.IntEnum): december = 12 +# If a month override was configured, check that it's a valid Month +# Prevents delaying an exception after the bot starts +if Client.month_override is not None: + Month(Client.month_override) + + class Roles(NamedTuple): admin = int(environ.get("SEASONALBOT_ADMIN_ROLE_ID", 267628507062992896)) announcements = 463658397560995840 -- cgit v1.2.3