Skip to content

Commit

Permalink
further fix for command parents (#1673)
Browse files Browse the repository at this point in the history
* further fix for command parents

end me

* Update changelog

Co-authored-by: BobDotCom <71356958+BobDotCom@users.noreply.github.com>
  • Loading branch information
NeloBlivion and BobDotCom authored Oct 6, 2022
1 parent 3bfe716 commit af4ee5e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
11 changes: 9 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ possible (see our
[Version Guarantees](https://docs.pycord.dev/en/stable/version_guarantees.html) for more
info).

## [Unreleased]
## [2.2.2] - 2022-10-05

### Fixed

- Fixed `parent` attribute of second level subcommands being set to the base level
command instead of the direct parent.
([#1673](https://github.com/Pycord-Development/pycord/pull/1673))

## [2.2.1] - 2022-10-05

Expand Down Expand Up @@ -391,7 +397,8 @@ info).
- Fix py3.10 UnionType checks issue.
([#1240](https://github.com/Pycord-Development/pycord/pull/1240))

[unreleased]: https://github.com/Pycord-Development/pycord/compare/v2.2.1...HEAD
[unreleased]: https://github.com/Pycord-Development/pycord/compare/v2.2.2...HEAD
[2.2.2]: https://github.com/Pycord-Development/pycord/compare/v2.2.1...v2.2.2
[2.2.1]: https://github.com/Pycord-Development/pycord/compare/v2.2.0...v2.2.1
[2.2.0]: https://github.com/Pycord-Development/pycord/compare/v2.1.3...v2.2.0
[2.1.3]: https://github.com/Pycord-Development/pycord/compare/v2.1.2...v2.1.3
Expand Down
5 changes: 4 additions & 1 deletion discord/cog.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,10 @@ def _inject(self: CogT, bot) -> CogT:

if isinstance(command, ApplicationCommand):
if isinstance(command, discord.SlashCommandGroup):
for x in command.walk_commands():
for x in command.subcommands:
if isinstance(x, discord.SlashCommandGroup):
for y in x.subcommands:
y.parent = x
x.parent = command
bot.add_application_command(command)

Expand Down

0 comments on commit af4ee5e

Please sign in to comment.