diff --git a/CHANGELOG.md b/CHANGELOG.md index e7f1865ce5..319ea735c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 @@ -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 diff --git a/discord/cog.py b/discord/cog.py index 40879fd402..a634e36910 100644 --- a/discord/cog.py +++ b/discord/cog.py @@ -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)