From fb753cf1a502ea0cbd6144504d358e4a72843469 Mon Sep 17 00:00:00 2001 From: "Nyeki.py" <84998222+Nekidev@users.noreply.github.com> Date: Fri, 18 Oct 2024 14:01:48 -0300 Subject: [PATCH] fix(bot): :ambulance: Bans not setting the time correctly. --- payphone/bot.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/payphone/bot.py b/payphone/bot.py index e60609c..fad71f0 100644 --- a/payphone/bot.py +++ b/payphone/bot.py @@ -177,7 +177,14 @@ class Payphone(commands.AutoShardedBot): if duration is not None: last_ban = ( - await models.Ban.filter(user_id=user_id) + await models.Ban.filter( + expressions.Q( + expires_at=None, + expires_at__gt=datetime.now(timezone.utc), + join_type="OR", + ), + user_id=user_id, + ) .order_by("-created_at") .limit(1) .first()