mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 11:18:54 -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:
|
if self.bot._last_exception:
|
||||||
for page in pagify(self.bot._last_exception, shorten_by=10):
|
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:
|
else:
|
||||||
await ctx.send(_("No exception has occurred yet."))
|
await ctx.send(_("No exception has occurred yet."))
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user