mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 03:08:55 -05:00
[V3 Events] modify CommandInvokeError handler to use the vague message as a fallback if a cog doesn't provide its own __error function (#1279)
This commit is contained in:
parent
7f0cca1baf
commit
a388d07f30
@ -172,7 +172,8 @@ def init_events(bot, cli_flags):
|
|||||||
exception_log += "".join(traceback.format_exception(type(error),
|
exception_log += "".join(traceback.format_exception(type(error),
|
||||||
error, error.__traceback__))
|
error, error.__traceback__))
|
||||||
bot._last_exception = exception_log
|
bot._last_exception = exception_log
|
||||||
await ctx.send(inline(message))
|
if not hasattr(ctx.cog, "_{0.command.cog_name}__error".format(ctx)):
|
||||||
|
await ctx.send(inline(message))
|
||||||
elif isinstance(error, commands.CommandNotFound):
|
elif isinstance(error, commands.CommandNotFound):
|
||||||
pass
|
pass
|
||||||
elif isinstance(error, commands.CheckFailure):
|
elif isinstance(error, commands.CheckFailure):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user