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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ These changes are available on the `master` branch, but have not yet been releas
([#2099](https://github.com/Pycord-Development/pycord/pull/2099))
- Changed the support from `orjson` to `msgspec` in the codebase.
([#2170](https://github.com/Pycord-Development/pycord/pull/2170))
- Changed the error message that appears after an attempt at creating a subcommand group
under a subcommand group.
([#2275](https://github.com/Pycord-Development/pycord/pull/2275))

### Removed

Expand Down
5 changes: 3 additions & 2 deletions discord/commands/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1303,8 +1303,9 @@ 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 slash command group can only have one level of subcommand groups"
)

sub_command_group = SlashCommandGroup(
name, description, guild_ids, parent=self, **kwargs
Expand Down
Loading