Skip to content

Commit b2e8bfd

Browse files
committed
Invert isinstance check as per review
1 parent e082596 commit b2e8bfd

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

bot/exts/help_channels/_cog.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,12 @@ async def claim_channel(self, message: discord.Message) -> None:
126126
log.info(f"Channel #{message.channel} was claimed by `{message.author.id}`.")
127127
await self.move_to_in_use(message.channel)
128128

129-
# Handle odd edge case of `message.author` being a `discord.User` (see bot#1839)
130-
if isinstance(message.author, discord.User):
131-
log.warning("`message.author` is a `discord.User` so not handling role change or sending DM.")
129+
# Handle odd edge case of `message.author` not being a `discord.Member` (see bot#1839)
130+
if not isinstance(message.author, discord.Member):
131+
log.warning(
132+
f"`message.author` ({message.author} / {message.author.id}) isn't a `discord.Member` so not handling "
133+
"role change or sending DM."
134+
)
132135
else:
133136
await self._handle_role_change(message.author, message.author.add_roles)
134137

0 commit comments

Comments
 (0)