aboutsummaryrefslogtreecommitdiff
path: root/discord/ext/commands/bot.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2017-03-20 23:59:23 -0400
committerRapptz <[email protected]>2017-03-21 00:46:12 -0400
commitfe588a4d527f80804543cea6dbb5743fcbd786e1 (patch)
tree2af2654b1f0a5c743eb186f2865dd329845a8543 /discord/ext/commands/bot.py
parentReconnect on any OSError. (diff)
downloaddiscord.py-fe588a4d527f80804543cea6dbb5743fcbd786e1.tar.xz
discord.py-fe588a4d527f80804543cea6dbb5743fcbd786e1.zip
[commands] Change GroupMixin.commands to all_commands
This is a breaking change as GroupMixin.commands now returns a set of unique Command objects.
Diffstat (limited to 'discord/ext/commands/bot.py')
-rw-r--r--discord/ext/commands/bot.py10
1 files changed, 5 insertions, 5 deletions
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