[commands] Change GroupMixin.commands to all_commands

This is a breaking change as GroupMixin.commands now returns a set
of unique Command objects.
This commit is contained in:
Rapptz
2017-03-20 23:59:23 -04:00
parent c90e52450a
commit fe588a4d52
3 changed files with 25 additions and 20 deletions

View File

@@ -171,7 +171,7 @@ class HelpFormatter:
"""int : Returns the largest name length of a command or if it has subcommands
the largest subcommand name."""
try:
commands = self.command.commands if not self.is_cog() else self.context.bot.commands
commands = self.command.all_commands if not self.is_cog() else self.context.bot.all_commands
if commands:
return max(map(lambda c: len(c.name) if self.show_hidden or not c.hidden else 0, commands.values()))
return 0
@@ -265,7 +265,7 @@ class HelpFormatter:
except CommandError:
return False
iterator = self.command.commands.items() if not self.is_cog() else self.context.bot.commands.items()
iterator = self.command.all_commands.items() if not self.is_cog() else self.context.bot.all_commands.items()
if self.show_check_failure:
return filter(sane_no_suspension_point_predicate, iterator)