diff options
| author | MarkKoz <[email protected]> | 2020-03-09 16:26:14 -0700 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2020-04-06 04:52:53 -0400 |
| commit | 2653ae7599d71578c66cd1b60743ead310c2a0bc (patch) | |
| tree | 84aff6ee5289a426f552e2404508abc1391fdfe2 | |
| parent | Documentation fixups for allowed mentions (diff) | |
| download | discord.py-2653ae7599d71578c66cd1b60743ead310c2a0bc.tar.xz discord.py-2653ae7599d71578c66cd1b60743ead310c2a0bc.zip | |
[commands] Stop yielding duplicate commands from walk_commands
| -rw-r--r-- | discord/ext/commands/core.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py index 03ba6b54..7fce002e 100644 --- a/discord/ext/commands/core.py +++ b/discord/ext/commands/core.py @@ -1136,8 +1136,12 @@ class GroupMixin: return command def walk_commands(self): - """An iterator that recursively walks through all commands and subcommands.""" - for command in tuple(self.all_commands.values()): + """An iterator that recursively walks through all commands and subcommands. + + .. versionchanged:: 1.4 + Duplicates due to aliases are no longer returned + """ + for command in self.commands: yield command if isinstance(command, GroupMixin): yield from command.walk_commands() |