From 63da81389736bd94bc921035e607ed1ea628e7f5 Mon Sep 17 00:00:00 2001 From: Dorukyum <53639936+Dorukyum@users.noreply.github.com> Date: Mon, 8 Jul 2024 14:54:22 +0300 Subject: [PATCH] chore: improve nesting error message (#2275) * chore: improve subgroup limit error message * Changelog * style(pre-commit): auto fixes from pre-commit.com hooks * Update discord/commands/core.py Co-authored-by: Lala Sabathil Signed-off-by: Dorukyum <53639936+Dorukyum@users.noreply.github.com> * Update core.py * style(pre-commit): auto fixes from pre-commit.com hooks * Update CHANGELOG.md * style(pre-commit): auto fixes from pre-commit.com hooks --------- Signed-off-by: Dorukyum <53639936+Dorukyum@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Lala Sabathil --- CHANGELOG.md | 2 ++ discord/commands/core.py | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c996d6e1e..320aa5b3fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -239,6 +239,8 @@ These changes are available on the `master` branch, but have not yet been releas ([#2170](https://github.com/Pycord-Development/pycord/pull/2170)) - `BridgeOption` must now be used for arguments in bridge commands. ([#2252](https://github.com/Pycord-Development/pycord/pull/2252)) +- Changed the error message that appears when attempting to add a subcommand group to a + subcommand group. ([#2275](https://github.com/Pycord-Development/pycord/pull/2275)) ### Removed diff --git a/discord/commands/core.py b/discord/commands/core.py index 3c886f2dfc..08d6f7780e 100644 --- a/discord/commands/core.py +++ b/discord/commands/core.py @@ -1425,8 +1425,7 @@ def create_subgroup( """ if self.parent is not None: - # TODO: Improve this error message - raise Exception("a subgroup cannot have a subgroup") + raise Exception("A subcommand group cannot be added to a subcommand group") sub_command_group = SlashCommandGroup( name, description, guild_ids, parent=self, **kwargs