mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-12-06 17:32:31 -05:00
Core - Add invoke error message customisation (#5894)
Co-authored-by: Jakub Kuczys <me@jacken.men>
This commit is contained in:
@@ -266,16 +266,21 @@ def init_events(bot, cli_flags):
|
||||
"Exception in command '{}'".format(ctx.command.qualified_name),
|
||||
exc_info=error.original,
|
||||
)
|
||||
|
||||
message = _(
|
||||
"Error in command '{command}'. Check your console or logs for details."
|
||||
).format(command=ctx.command.qualified_name)
|
||||
exception_log = "Exception in command '{}'\n" "".format(ctx.command.qualified_name)
|
||||
exception_log += "".join(
|
||||
traceback.format_exception(type(error), error, error.__traceback__)
|
||||
)
|
||||
bot._last_exception = exception_log
|
||||
await ctx.send(inline(message))
|
||||
|
||||
message = await bot._config.invoke_error_msg()
|
||||
if not message:
|
||||
if ctx.author.id in bot.owner_ids:
|
||||
message = inline(
|
||||
_("Error in command '{command}'. Check your console or logs for details.")
|
||||
)
|
||||
else:
|
||||
message = inline(_("Error in command '{command}'."))
|
||||
await ctx.send(message.replace("{command}", ctx.command.qualified_name))
|
||||
elif isinstance(error, commands.CommandNotFound):
|
||||
help_settings = await HelpSettings.from_context(ctx)
|
||||
fuzzy_commands = await fuzzy_command_search(
|
||||
|
||||
Reference in New Issue
Block a user