From fe588a4d527f80804543cea6dbb5743fcbd786e1 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Mon, 20 Mar 2017 23:59:23 -0400 Subject: [commands] Change GroupMixin.commands to all_commands This is a breaking change as GroupMixin.commands now returns a set of unique Command objects. --- discord/ext/commands/bot.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'discord/ext/commands/bot.py') diff --git a/discord/ext/commands/bot.py b/discord/ext/commands/bot.py index 733cfec2..3f529277 100644 --- a/discord/ext/commands/bot.py +++ b/discord/ext/commands/bot.py @@ -93,7 +93,7 @@ def _default_help_command(ctx, *commands : str): if name in bot.cogs: command = bot.cogs[name] else: - command = bot.commands.get(name) + command = bot.all_commands.get(name) if command is None: yield from destination.send(bot.command_not_found.format(name)) return @@ -101,7 +101,7 @@ def _default_help_command(ctx, *commands : str): pages = yield from bot.formatter.format_help_for(ctx, command) else: name = _mention_pattern.sub(repl, commands[0]) - command = bot.commands.get(name) + command = bot.all_commands.get(name) if command is None: yield from destination.send(bot.command_not_found.format(name)) return @@ -109,7 +109,7 @@ def _default_help_command(ctx, *commands : str): for key in commands[1:]: try: key = _mention_pattern.sub(repl, key) - command = command.commands.get(key) + command = command.all_commands.get(key) if command is None: yield from destination.send(bot.command_not_found.format(key)) return @@ -564,7 +564,7 @@ class BotBase(GroupMixin): self.remove_cog(cogname) # first remove all the commands from the module - for command in self.commands.copy().values(): + for command in self.all_commands.copy().values(): if command.module is lib: command.module = None if isinstance(command, GroupMixin): @@ -676,7 +676,7 @@ class BotBase(GroupMixin): invoker = view.get_word() ctx.invoked_with = invoker ctx.prefix = invoked_prefix - ctx.command = self.commands.get(invoker) + ctx.command = self.all_commands.get(invoker) return ctx @asyncio.coroutine -- cgit v1.2.3