diff options
| author | Rapptz <[email protected]> | 2016-06-04 22:29:50 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2016-06-04 22:29:50 -0400 |
| commit | 37dfe38af5603ccbbf820dc4de3aaf88e582fc58 (patch) | |
| tree | b89b5a2bf9fa37d55e83842bb83a25f1a039077c /discord/ext | |
| parent | [commands] Fix bug where subgroups would be repeatedly called. (diff) | |
| download | discord.py-37dfe38af5603ccbbf820dc4de3aaf88e582fc58.tar.xz discord.py-37dfe38af5603ccbbf820dc4de3aaf88e582fc58.zip | |
[commands] Fix bug where Context.command would not update.
Diffstat (limited to 'discord/ext')
| -rw-r--r-- | discord/ext/commands/bot.py | 1 | ||||
| -rw-r--r-- | discord/ext/commands/core.py | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/discord/ext/commands/bot.py b/discord/ext/commands/bot.py index 59a498d7..8814021b 100644 --- a/discord/ext/commands/bot.py +++ b/discord/ext/commands/bot.py @@ -638,7 +638,6 @@ class Bot(GroupMixin, discord.Client): if invoker in self.commands: command = self.commands[invoker] self.dispatch('command', command, ctx) - ctx.command = command try: yield from command.invoke(ctx) except CommandError as e: diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py index e5c67c70..46a5d89b 100644 --- a/discord/ext/commands/core.py +++ b/discord/ext/commands/core.py @@ -365,6 +365,7 @@ class Command: @asyncio.coroutine def invoke(self, ctx): + ctx.command = self self._verify_checks(ctx) yield from self._parse_arguments(ctx) @@ -588,6 +589,7 @@ class Group(GroupMixin, Command): def invoke(self, ctx): early_invoke = not self.invoke_without_command if early_invoke: + ctx.command = self self._verify_checks(ctx) yield from self._parse_arguments(ctx) |