diff --git a/redbot/core/core_commands.py b/redbot/core/core_commands.py index cc090ec9b..c3bb97778 100644 --- a/redbot/core/core_commands.py +++ b/redbot/core/core_commands.py @@ -1139,7 +1139,14 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): if self.bot._last_exception: for page in pagify(self.bot._last_exception, shorten_by=10): - await destination.send(box(page, lang="py")) + try: + await destination.send(box(page, lang="py")) + except discord.HTTPException: + await ctx.channel.send( + "I couldn't send the traceback message to you in DM. " + "Either you blocked me or you disabled DMs in this server." + ) + return else: await ctx.send(_("No exception has occurred yet."))