From 3e6cb75457be90f1fd4bd0a4616a3dd09ba9f64d Mon Sep 17 00:00:00 2001 From: profitroll Date: Fri, 25 Apr 2025 00:25:00 +0200 Subject: [PATCH] Fixed time comparison bug --- cogs/stage.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cogs/stage.py b/cogs/stage.py index e1b1a82..c3fb9a7 100644 --- a/cogs/stage.py +++ b/cogs/stage.py @@ -20,7 +20,11 @@ async def validate_event_status( await ctx.respond("This event was cancelled.") return - if event.starts <= datetime.now(tz=ZoneInfo("UTC")) <= event.ends: + if ( + event.starts.replace(tzinfo=ZoneInfo("UTC")) + <= datetime.now(tz=ZoneInfo("UTC")) + <= event.ends.replace(tzinfo=ZoneInfo("UTC")) + ): # TODO Make a nice message await ctx.respond("Ongoing events cannot be modified.") return