diff options
Diffstat (limited to '')
| -rw-r--r-- | bot/exts/help_channels/_cog.py | 21 | 
1 files changed, 19 insertions, 2 deletions
| diff --git a/bot/exts/help_channels/_cog.py b/bot/exts/help_channels/_cog.py index 541c791e5..6d061c8ca 100644 --- a/bot/exts/help_channels/_cog.py +++ b/bot/exts/help_channels/_cog.py @@ -111,14 +111,31 @@ class HelpChannels(commands.Cog):          """          log.info(f"Channel #{message.channel} was claimed by `{message.author.id}`.") +        try: +            await self.move_to_in_use(message.channel) +        except discord.DiscordServerError: +            try: +                await message.channel.send( +                    "The bot encountered a Discord API error while trying to move this channel, please try again later." +                ) +            except Exception as e: +                log.warning("Error occurred while sending fail claim message:", exc_info=e) +            log.info( +                "500 error from Discord when moving #%s (%d) to in-use for %s (%d). Cancelling claim.", +                message.channel.name, +                message.channel.id, +                message.author.name, +                message.author.id, +            ) +            self.bot.stats.incr("help.failed_claims.500_on_move") +            return +          embed = discord.Embed(              description=f"Channel claimed by {message.author.mention}.",              color=constants.Colours.bright_green,          )          await message.channel.send(embed=embed) -        await self.move_to_in_use(message.channel) -          # Handle odd edge case of `message.author` not being a `discord.Member` (see bot#1839)          if not isinstance(message.author, discord.Member):              log.debug(f"{message.author} ({message.author.id}) isn't a member. Not giving cooldown role or sending DM.") | 
