mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 11:18:54 -05:00
Add non-generic message when loading a cog with command name that is already registered (#3870)
* Add non-generic message when loading a cog with command name that is already registered * Use regex instead and add i18n support * This requires d.py 1.4
This commit is contained in:
parent
ad48ef6efd
commit
991cd46ea3
@ -174,6 +174,20 @@ class CoreLogic:
|
||||
except errors.CogLoadError as e:
|
||||
failed_with_reason_packages.append((name, str(e)))
|
||||
except Exception as e:
|
||||
if isinstance(e, commands.CommandRegistrationError):
|
||||
if e.alias_conflict:
|
||||
error_message = _(
|
||||
"Alias {alias_name} is already an existing command"
|
||||
" or alias in one of the loaded cogs."
|
||||
).format(alias_name=inline(e.name))
|
||||
else:
|
||||
error_message = _(
|
||||
"Command {command_name} is already an existing command"
|
||||
" or alias in one of the loaded cogs."
|
||||
).format(command_name=inline(e.name))
|
||||
failed_with_reason_packages.append((name, error_message))
|
||||
continue
|
||||
|
||||
log.exception("Package loading failed", exc_info=e)
|
||||
|
||||
exception_log = "Exception during loading of package\n"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user