Fixed addcommand conflict messaging for non-custom commands.
CI / Formatting (push) Successful in 5s
CI / Linting (push) Successful in 5s
CI / Tests (Python 3.12) (push) Successful in 2m57s
CI / Tests (Python 3.13) (push) Successful in 2m56s
CI / Tests (Python 3.14) (push) Successful in 2m49s
CI / Type Checking (push) Successful in 9s
CI / Spelling (push) Successful in 4s

This commit is contained in:
2026-05-11 12:05:36 -04:00
parent 06b4a0bb9c
commit 62c5cd0ba5
3 changed files with 60 additions and 2 deletions
@@ -156,11 +156,19 @@ class CommandManager:
:param response: Response template.
:return: Snapshot of the created command.
:raises InvalidNameError: If name is invalid.
:raises CommandAlreadyExistsError: If name conflicts with any command.
:raises CommandAlreadyExistsError: If name conflicts with a custom command.
:raises NotCustomCommandError: If name conflicts with a non-custom command.
:raises InactiveCommandError: If name conflicts with an inactive custom command.
"""
if not NAME_RE.match(name):
raise InvalidNameError(name)
if self._commands.exists(name):
try:
command = await self._repo.get(name)
except CommandNotFoundError as err:
raise NotCustomCommandError(name) from err
if self._commands.get(command.name) is None:
raise InactiveCommandError(command.name)
raise CommandAlreadyExistsError(name)
default_cooldown: int = self._ctx.config.get("default_cooldown", 5)