Skip to content

Commit af4ee5e

Browse files
further fix for command parents (#1673)
* further fix for command parents end me * Update changelog Co-authored-by: BobDotCom <[email protected]>
1 parent 3bfe716 commit af4ee5e

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

CHANGELOG.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@ possible (see our
88
[Version Guarantees](https://docs.pycord.dev/en/stable/version_guarantees.html) for more
99
info).
1010

11-
## [Unreleased]
11+
## [2.2.2] - 2022-10-05
12+
13+
### Fixed
14+
15+
- Fixed `parent` attribute of second level subcommands being set to the base level
16+
command instead of the direct parent.
17+
([#1673](https://github.com/Pycord-Development/pycord/pull/1673))
1218

1319
## [2.2.1] - 2022-10-05
1420

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

394-
[unreleased]: https://github.com/Pycord-Development/pycord/compare/v2.2.1...HEAD
400+
[unreleased]: https://github.com/Pycord-Development/pycord/compare/v2.2.2...HEAD
401+
[2.2.2]: https://github.com/Pycord-Development/pycord/compare/v2.2.1...v2.2.2
395402
[2.2.1]: https://github.com/Pycord-Development/pycord/compare/v2.2.0...v2.2.1
396403
[2.2.0]: https://github.com/Pycord-Development/pycord/compare/v2.1.3...v2.2.0
397404
[2.1.3]: https://github.com/Pycord-Development/pycord/compare/v2.1.2...v2.1.3

discord/cog.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,10 @@ def _inject(self: CogT, bot) -> CogT:
532532

533533
if isinstance(command, ApplicationCommand):
534534
if isinstance(command, discord.SlashCommandGroup):
535-
for x in command.walk_commands():
535+
for x in command.subcommands:
536+
if isinstance(x, discord.SlashCommandGroup):
537+
for y in x.subcommands:
538+
y.parent = x
536539
x.parent = command
537540
bot.add_application_command(command)
538541

0 commit comments

Comments
 (0)