[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:
palmtree5 2018-02-18 17:59:46 -09:00 committed by Kowlin
parent 7f0cca1baf
commit a388d07f30

View File

@ -172,6 +172,7 @@ 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
if not hasattr(ctx.cog, "_{0.command.cog_name}__error".format(ctx)):
await ctx.send(inline(message)) await ctx.send(inline(message))
elif isinstance(error, commands.CommandNotFound): elif isinstance(error, commands.CommandNotFound):
pass pass