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

fix: SlashCommandGroup.walk_commands() error #1838

Merged
merged 2 commits into from
Feb 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions discord/commands/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1317,13 +1317,13 @@ async def invoke_autocomplete_callback(self, ctx: AutocompleteContext) -> None:
ctx.interaction.data = option
await command.invoke_autocomplete_callback(ctx)

def walk_commands(self) -> Generator[SlashCommand, None, None]:
"""An iterator that recursively walks through all slash commands in this group.
def walk_commands(self) -> Generator[SlashCommand | SlashCommandGroup, None, None]:
"""An iterator that recursively walks through all slash commands and groups in this group.

Yields
------
:class:`.SlashCommand`
A slash command from the group.
:class:`.SlashCommand` | :class:`.SlashCommandGroup`
A nested slash command or slash command group from the group.
"""
for command in self.subcommands:
if isinstance(command, SlashCommandGroup):
Expand Down