From 37dfe38af5603ccbbf820dc4de3aaf88e582fc58 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Sat, 4 Jun 2016 22:29:50 -0400 Subject: [PATCH] [commands] Fix bug where Context.command would not update. --- discord/ext/commands/bot.py | 1 - discord/ext/commands/core.py | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/discord/ext/commands/bot.py b/discord/ext/commands/bot.py index 59a498d74..8814021b6 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 e5c67c70c..46a5d89b6 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)