diff --git a/discord/commands/core.py b/discord/commands/core.py index 792adda6d7..b43f756b01 100644 --- a/discord/commands/core.py +++ b/discord/commands/core.py @@ -1317,13 +1317,15 @@ 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:`.SlashCommandGroup` + A nested slash command group from the group. """ for command in self.subcommands: if isinstance(command, SlashCommandGroup):