aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2019-05-11 18:17:57 -0400
committerRapptz <[email protected]>2019-05-11 18:17:57 -0400
commitf74d73327b6c236173f312d85f84cd9ace057099 (patch)
tree924a9a9648de4534db4f7cfb62cbf3f493a27a91
parentVersion bump to v1.1.1 (diff)
downloaddiscord.py-f74d73327b6c236173f312d85f84cd9ace057099.tar.xz
discord.py-f74d73327b6c236173f312d85f84cd9ace057099.zip
[commands] Explicitly assign invoked_subcommand to None before invoking
This should fix instances of it not working as expected in nested groups.
-rw-r--r--discord/ext/commands/core.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py
index f5890202..9a0d0c3f 100644
--- a/discord/ext/commands/core.py
+++ b/discord/ext/commands/core.py
@@ -1132,6 +1132,7 @@ class Group(GroupMixin, Command):
return ret
async def invoke(self, ctx):
+ ctx.invoked_subcommand = None
early_invoke = not self.invoke_without_command
if early_invoke:
await self.prepare(ctx)
@@ -1159,6 +1160,7 @@ class Group(GroupMixin, Command):
await super().invoke(ctx)
async def reinvoke(self, ctx, *, call_hooks=False):
+ ctx.invoked_subcommand = None
early_invoke = not self.invoke_without_command
if early_invoke:
ctx.command = self