Browse Source

[commands] Stop yielding duplicate commands from walk_commands

pull/2639/head
MarkKoz 5 years ago
committed by Rapptz
parent
commit
2653ae7599
  1. 8
      discord/ext/commands/core.py

8
discord/ext/commands/core.py

@ -1136,8 +1136,12 @@ class GroupMixin:
return command return command
def walk_commands(self): def walk_commands(self):
"""An iterator that recursively walks through all commands and subcommands.""" """An iterator that recursively walks through all commands and subcommands.
for command in tuple(self.all_commands.values()):
.. versionchanged:: 1.4
Duplicates due to aliases are no longer returned
"""
for command in self.commands:
yield command yield command
if isinstance(command, GroupMixin): if isinstance(command, GroupMixin):
yield from command.walk_commands() yield from command.walk_commands()

Loading…
Cancel
Save