diff options
-rw-r--r-- | bot/exts/help_channels/_cog.py | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/bot/exts/help_channels/_cog.py b/bot/exts/help_channels/_cog.py index 498305b47..3c6cf7f26 100644 --- a/bot/exts/help_channels/_cog.py +++ b/bot/exts/help_channels/_cog.py @@ -125,14 +125,21 @@ class HelpChannels(commands.Cog): """ log.info(f"Channel #{message.channel} was claimed by `{message.author.id}`.") await self.move_to_in_use(message.channel) - await self._handle_role_change(message.author, message.author.add_roles) - await _message.pin(message) + # 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.id}) isn't a member. Not giving cooldown role or sending DM." + ) + else: + await self._handle_role_change(message.author, message.author.add_roles) - try: - await _message.dm_on_open(message) - except Exception as e: - log.warning("Error occurred while sending DM:", exc_info=e) + try: + await _message.dm_on_open(message) + except Exception as e: + log.warning("Error occurred while sending DM:", exc_info=e) + + await _message.pin(message) # Add user with channel for dormant check. await _caches.claimants.set(message.channel.id, message.author.id) |