mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 03:08:55 -05:00
[Core] Catch errors about blocked DMs in [p]traceback (#4329)
This commit is contained in:
parent
ddc5660f2c
commit
47d9069108
@ -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):
|
||||
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."))
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user