diff options
| -rw-r--r-- | bot/cogs/filtering.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/bot/cogs/filtering.py b/bot/cogs/filtering.py index 17113d551..c57ab0688 100644 --- a/bot/cogs/filtering.py +++ b/bot/cogs/filtering.py @@ -61,7 +61,7 @@ class Filtering(Cog): def __init__(self, bot: Bot): self.bot = bot - self.name_lock: Optional[asyncio.Lock] = None + self.name_lock = asyncio.Lock() staff_mistake_str = "If you believe this was a mistake, please let staff know!" self.filters = { @@ -137,9 +137,6 @@ class Filtering(Cog): async def bad_words_in_name(self, msg: Message) -> None: """Check bad words from user display name. When there is more than 3 days after last alert, send new alert.""" - if not self.name_lock: - self.name_lock = asyncio.Lock() - # Use lock to avoid race conditions async with self.name_lock: # Check does nickname have match in filters. |