Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: improve nesting error message #2275

Merged
merged 10 commits into from
Jul 8, 2024
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
Loading