[commands] Stop yielding duplicate commands from walk_commands

This commit is contained in:
MarkKoz 2020-03-09 16:26:14 -07:00 committed by Rapptz
parent 8ff285fcbc
commit 2653ae7599

View File

@ -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()