Skip to content

Commit

Permalink
chore: improve nesting error message (#2275)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
Signed-off-by: Dorukyum <[email protected]>

* 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 <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Lala Sabathil <[email protected]>
  • Loading branch information
3 people authored Jul 8, 2024
1 parent e25527f commit 63da813
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 1 addition & 2 deletions discord/commands/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 63da813

Please sign in to comment.