aboutsummaryrefslogtreecommitdiffstats
path: root/bot/utils/checks.py
diff options
context:
space:
mode:
Diffstat (limited to 'bot/utils/checks.py')
-rw-r--r--bot/utils/checks.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/bot/utils/checks.py b/bot/utils/checks.py
index f21d2ddd..418bb7ad 100644
--- a/bot/utils/checks.py
+++ b/bot/utils/checks.py
@@ -1,7 +1,6 @@
import datetime
import logging
-from collections.abc import Container, Iterable
-from typing import Callable, Optional
+from collections.abc import Callable, Container, Iterable
from discord.ext.commands import (
BucketType, CheckFailure, Cog, Command, CommandOnCooldown, Context, Cooldown, CooldownMapping
@@ -15,7 +14,7 @@ log = logging.getLogger(__name__)
class InWhitelistCheckFailure(CheckFailure):
"""Raised when the `in_whitelist` check fails."""
- def __init__(self, redirect_channel: Optional[int]):
+ def __init__(self, redirect_channel: int | None):
self.redirect_channel = redirect_channel
if redirect_channel:
@@ -33,7 +32,7 @@ def in_whitelist_check(
channels: Container[int] = (),
categories: Container[int] = (),
roles: Container[int] = (),
- redirect: Optional[int] = constants.Channels.sir_lancebot_playground,
+ redirect: int | None = constants.Channels.sir_lancebot_playground,
fail_silently: bool = False,
) -> bool:
"""
@@ -153,7 +152,7 @@ def cooldown_with_role_bypass(rate: int, per: float, type: BucketType = BucketTy
return
# Cooldown logic, taken from discord.py internals.
- current = ctx.message.created_at.replace(tzinfo=datetime.timezone.utc).timestamp()
+ current = ctx.message.created_at.replace(tzinfo=datetime.UTC).timestamp()
bucket = buckets.get_bucket(ctx.message)
retry_after = bucket.update_rate_limit(current)
if retry_after: