aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Izan <[email protected]>2021-10-19 09:11:51 +0100
committerGravatar Izan <[email protected]>2021-10-19 09:11:51 +0100
commitb2e8bfdc47339714ec014a13e2018e03c0931fe4 (patch)
treec9c391ef7beed528ea6bb8d8a021495e765a3499
parentAdd handling for when `message.author` is a `discord.User` (diff)
Invert `isinstance` check as per review
-rw-r--r--bot/exts/help_channels/_cog.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/bot/exts/help_channels/_cog.py b/bot/exts/help_channels/_cog.py
index ecffc59fd..b3da1e315 100644
--- a/bot/exts/help_channels/_cog.py
+++ b/bot/exts/help_channels/_cog.py
@@ -126,9 +126,12 @@ class HelpChannels(commands.Cog):
log.info(f"Channel #{message.channel} was claimed by `{message.author.id}`.")
await self.move_to_in_use(message.channel)
- # Handle odd edge case of `message.author` being a `discord.User` (see bot#1839)
- if isinstance(message.author, discord.User):
- log.warning("`message.author` is a `discord.User` so not handling role change or sending DM.")
+ # Handle odd edge case of `message.author` not being a `discord.Member` (see bot#1839)
+ if not isinstance(message.author, discord.Member):
+ log.warning(
+ f"`message.author` ({message.author} / {message.author.id}) isn't a `discord.Member` so not handling "
+ "role change or sending DM."
+ )
else:
await self._handle_role_change(message.author, message.author.add_roles)