fix(bot): 🚑 Bans not setting the time correctly.
This commit is contained in:
+8
-1
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user