mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-07 20:28:38 +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
|
return ret
|
||||||
|
|
||||||
async def invoke(self, ctx):
|
async def invoke(self, ctx):
|
||||||
|
ctx.invoked_subcommand = None
|
||||||
early_invoke = not self.invoke_without_command
|
early_invoke = not self.invoke_without_command
|
||||||
if early_invoke:
|
if early_invoke:
|
||||||
await self.prepare(ctx)
|
await self.prepare(ctx)
|
||||||
@ -1159,6 +1160,7 @@ class Group(GroupMixin, Command):
|
|||||||
await super().invoke(ctx)
|
await super().invoke(ctx)
|
||||||
|
|
||||||
async def reinvoke(self, ctx, *, call_hooks=False):
|
async def reinvoke(self, ctx, *, call_hooks=False):
|
||||||
|
ctx.invoked_subcommand = None
|
||||||
early_invoke = not self.invoke_without_command
|
early_invoke = not self.invoke_without_command
|
||||||
if early_invoke:
|
if early_invoke:
|
||||||
ctx.command = self
|
ctx.command = self
|
||||||
|
Loading…
x
Reference in New Issue
Block a user