From 424ed03e8790b8cde17e00bc0b39c279401520ea Mon Sep 17 00:00:00 2001 From: EQUENOS <50338932+EQUENOS@users.noreply.github.com> Date: Mon, 18 Sep 2023 16:10:20 +0300 Subject: [PATCH] Update docs and add changelog --- changelog/260.bugfix.rst | 1 + changelog/260.deprecate.0.rst | 1 + changelog/260.deprecate.1.rst | 1 + changelog/260.deprecate.2.rst | 1 + changelog/260.deprecate.3.rst | 1 + changelog/260.deprecate.4.rst | 1 + changelog/260.deprecate.5.rst | 1 + changelog/260.deprecate.6.rst | 1 + changelog/260.deprecate.7.rst | 1 + changelog/260.deprecate.8.rst | 1 + changelog/260.feature.0.rst | 1 + changelog/260.feature.1.rst | 1 + changelog/260.feature.2.rst | 1 + changelog/260.feature.3.rst | 1 + changelog/260.feature.4.rst | 1 + changelog/260.feature.5.rst | 1 + disnake/ext/commands/errors.py | 1 + docs/ext/commands/api/exceptions.rst | 3 +++ 18 files changed, 20 insertions(+) create mode 100644 changelog/260.bugfix.rst create mode 100644 changelog/260.deprecate.0.rst create mode 100644 changelog/260.deprecate.1.rst create mode 100644 changelog/260.deprecate.2.rst create mode 100644 changelog/260.deprecate.3.rst create mode 100644 changelog/260.deprecate.4.rst create mode 100644 changelog/260.deprecate.5.rst create mode 100644 changelog/260.deprecate.6.rst create mode 100644 changelog/260.deprecate.7.rst create mode 100644 changelog/260.deprecate.8.rst create mode 100644 changelog/260.feature.0.rst create mode 100644 changelog/260.feature.1.rst create mode 100644 changelog/260.feature.2.rst create mode 100644 changelog/260.feature.3.rst create mode 100644 changelog/260.feature.4.rst create mode 100644 changelog/260.feature.5.rst diff --git a/changelog/260.bugfix.rst b/changelog/260.bugfix.rst new file mode 100644 index 0000000000..3a77eb513c --- /dev/null +++ b/changelog/260.bugfix.rst @@ -0,0 +1 @@ +|commands| Allow registering 2 commands with the same type and name in different guilds. diff --git a/changelog/260.deprecate.0.rst b/changelog/260.deprecate.0.rst new file mode 100644 index 0000000000..5f001a5a2f --- /dev/null +++ b/changelog/260.deprecate.0.rst @@ -0,0 +1 @@ +|commands| :attr:`InteractionBotBase.all_slash_commands` is deprecated. diff --git a/changelog/260.deprecate.1.rst b/changelog/260.deprecate.1.rst new file mode 100644 index 0000000000..b8f41dbdff --- /dev/null +++ b/changelog/260.deprecate.1.rst @@ -0,0 +1 @@ +|commands| :attr:`InteractionBotBase.all_user_commands` is deprecated. diff --git a/changelog/260.deprecate.2.rst b/changelog/260.deprecate.2.rst new file mode 100644 index 0000000000..7eb5aad372 --- /dev/null +++ b/changelog/260.deprecate.2.rst @@ -0,0 +1 @@ +|commands| :attr:`InteractionBotBase.all_message_commands` is deprecated. diff --git a/changelog/260.deprecate.3.rst b/changelog/260.deprecate.3.rst new file mode 100644 index 0000000000..bd6cfc053d --- /dev/null +++ b/changelog/260.deprecate.3.rst @@ -0,0 +1 @@ +|commands| :meth:`InteractionBotBase.add_slash_command` is deprecated. diff --git a/changelog/260.deprecate.4.rst b/changelog/260.deprecate.4.rst new file mode 100644 index 0000000000..371f949640 --- /dev/null +++ b/changelog/260.deprecate.4.rst @@ -0,0 +1 @@ +|commands| :meth:`InteractionBotBase.add_user_command` is deprecated. diff --git a/changelog/260.deprecate.5.rst b/changelog/260.deprecate.5.rst new file mode 100644 index 0000000000..ccd4e28be5 --- /dev/null +++ b/changelog/260.deprecate.5.rst @@ -0,0 +1 @@ +|commands| :meth:`InteractionBotBase.add_message_command` is deprecated. diff --git a/changelog/260.deprecate.6.rst b/changelog/260.deprecate.6.rst new file mode 100644 index 0000000000..117b504a0a --- /dev/null +++ b/changelog/260.deprecate.6.rst @@ -0,0 +1 @@ +|commands| :meth:`InteractionBotBase.remove_slash_command` is deprecated. diff --git a/changelog/260.deprecate.7.rst b/changelog/260.deprecate.7.rst new file mode 100644 index 0000000000..c1930a4bc2 --- /dev/null +++ b/changelog/260.deprecate.7.rst @@ -0,0 +1 @@ +|commands| :meth:`InteractionBotBase.remove_user_command` is deprecated. diff --git a/changelog/260.deprecate.8.rst b/changelog/260.deprecate.8.rst new file mode 100644 index 0000000000..c45e1eee27 --- /dev/null +++ b/changelog/260.deprecate.8.rst @@ -0,0 +1 @@ +|commands| :meth:`InteractionBotBase.remove_message_command` is deprecated. diff --git a/changelog/260.feature.0.rst b/changelog/260.feature.0.rst new file mode 100644 index 0000000000..b10c4b3332 --- /dev/null +++ b/changelog/260.feature.0.rst @@ -0,0 +1 @@ +|commands| Add :meth:`InteractionBotBase.add_app_command`. diff --git a/changelog/260.feature.1.rst b/changelog/260.feature.1.rst new file mode 100644 index 0000000000..e6a715b02b --- /dev/null +++ b/changelog/260.feature.1.rst @@ -0,0 +1 @@ +|commands| Add :meth:`InteractionBotBase.remove_app_command`. diff --git a/changelog/260.feature.2.rst b/changelog/260.feature.2.rst new file mode 100644 index 0000000000..aa06ab03e5 --- /dev/null +++ b/changelog/260.feature.2.rst @@ -0,0 +1 @@ +|commands| Add ``guild_id`` parameter to :meth:`InteractionBotBase.get_slash_command`. diff --git a/changelog/260.feature.3.rst b/changelog/260.feature.3.rst new file mode 100644 index 0000000000..da14bd48b8 --- /dev/null +++ b/changelog/260.feature.3.rst @@ -0,0 +1 @@ +|commands| Add ``guild_id`` parameter to :meth:`InteractionBotBase.get_user_command`. diff --git a/changelog/260.feature.4.rst b/changelog/260.feature.4.rst new file mode 100644 index 0000000000..6523484883 --- /dev/null +++ b/changelog/260.feature.4.rst @@ -0,0 +1 @@ +|commands| Add ``guild_id`` parameter to :meth:`InteractionBotBase.get_message_command`. diff --git a/changelog/260.feature.5.rst b/changelog/260.feature.5.rst new file mode 100644 index 0000000000..fb1c42fdee --- /dev/null +++ b/changelog/260.feature.5.rst @@ -0,0 +1 @@ +|commands| Add :class:`AppCommandRegistrationError`. diff --git a/disnake/ext/commands/errors.py b/disnake/ext/commands/errors.py index 3e9a9360b6..f2fdb2893f 100644 --- a/disnake/ext/commands/errors.py +++ b/disnake/ext/commands/errors.py @@ -1023,6 +1023,7 @@ def __init__(self, name: str, *, alias_conflict: bool = False) -> None: type_ = "alias" if alias_conflict else "command" super().__init__(f"The {type_} {name} is already an existing command or alias.") + # we inherit CommandRegistrationError for backwards compatibility, # because this error replaced CommandRegistrationError in several places class AppCommandRegistrationError(CommandRegistrationError): diff --git a/docs/ext/commands/api/exceptions.rst b/docs/ext/commands/api/exceptions.rst index bde1d7d446..4dd874f51e 100644 --- a/docs/ext/commands/api/exceptions.rst +++ b/docs/ext/commands/api/exceptions.rst @@ -186,6 +186,9 @@ Exceptions .. autoexception:: CommandRegistrationError :members: +.. autoexception:: AppCommandRegistrationError + :members: + Exception Hierarchy ~~~~~~~~~~~~~~~~~~~