mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-07 04:17:16 +00:00
[commands] Explicitly assign invoked_subcommand to None before invoking
This should fix instances of it not working as expected in nested groups.
This commit is contained in:
parent
26a6970882
commit
f74d73327b
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user