From 541030785be57c6c216b3a4a7f2ce09a4b94bf85 Mon Sep 17 00:00:00 2001 From: jenz Date: Thu, 7 Jul 2022 18:20:59 +0200 Subject: [PATCH] added hour check to avoid hours with no restrictions --- event_notification/python/discord_event.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/event_notification/python/discord_event.py b/event_notification/python/discord_event.py index 69591759..9620ef4b 100644 --- a/event_notification/python/discord_event.py +++ b/event_notification/python/discord_event.py @@ -62,9 +62,10 @@ async def discord_task(): event_maps = res[0].split(" ") event_date = res[1].strip() today_formatted = f"{datetime.now():%d-%m-%Y}".replace("-", "/") + today_hour = int(f"{datetime.now():%H}") #print("today_formatted: ", today_formatted) #print("event_date: ", event_date) - if today_formatted == event_date: + if today_formatted == event_date and today_hour > 10: sql_statement = f""" update unloze_event.event set set_map_cooldown = true