diff options
author | 2022-02-01 19:24:28 +0000 | |
---|---|---|
committer | 2022-02-01 19:24:28 +0000 | |
commit | a350a90c4cc1fba003eb07d6269a57e02708c240 (patch) | |
tree | 0ff74b6c879e6e5e54b595828f2c68db2394f70b | |
parent | ✨ Check for bad username when user joins or switches voice channel (diff) |
♻️Import errors from `discord` explicitly
-rw-r--r-- | bot/exts/filters/filtering.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/bot/exts/filters/filtering.py b/bot/exts/filters/filtering.py index 7b708f9a9..f16e2af02 100644 --- a/bot/exts/filters/filtering.py +++ b/bot/exts/filters/filtering.py @@ -6,13 +6,13 @@ from typing import Any, Dict, List, Mapping, NamedTuple, Optional, Tuple, Union import arrow import dateutil.parser -import discord.errors +import discord import regex import tldextract from async_rediscache import RedisCache from botcore.regex import DISCORD_INVITE from dateutil.relativedelta import relativedelta -from discord import Colour, HTTPException, Member, Message, NotFound, TextChannel, VoiceState +from discord import Colour, HTTPException, Member, Message, NotFound, TextChannel, VoiceState, Forbidden from discord.ext.commands import Cog from discord.utils import escape_markdown @@ -360,7 +360,7 @@ class Filtering(Cog): # In addition, to avoid sending two notifications to the user, the # logs, and mod_alert, we return if the message no longer exists. await msg.delete() - except discord.errors.NotFound: + except NotFound: return # Notify the user if the filter specifies @@ -664,7 +664,7 @@ class Filtering(Cog): """ try: await filtered_member.send(reason) - except discord.errors.Forbidden: + except Forbidden: await channel.send(f"{filtered_member.mention} {reason}") def schedule_msg_delete(self, msg: dict) -> None: |