[commands] Add Context.invoked_parents
This commit is contained in:
@ -1342,6 +1342,8 @@ class Group(GroupMixin, Command):
|
||||
injected = hooked_wrapped_callback(self, ctx, self.callback)
|
||||
await injected(*ctx.args, **ctx.kwargs)
|
||||
|
||||
ctx.invoked_parents.append(ctx.invoked_with)
|
||||
|
||||
if trigger and ctx.invoked_subcommand:
|
||||
ctx.invoked_with = trigger
|
||||
await ctx.invoked_subcommand.invoke(ctx)
|
||||
@ -1380,6 +1382,8 @@ class Group(GroupMixin, Command):
|
||||
if call_hooks:
|
||||
await self.call_after_hooks(ctx)
|
||||
|
||||
ctx.invoked_parents.append(ctx.invoked_with)
|
||||
|
||||
if trigger and ctx.invoked_subcommand:
|
||||
ctx.invoked_with = trigger
|
||||
await ctx.invoked_subcommand.reinvoke(ctx, call_hooks=call_hooks)
|
||||
|
Reference in New Issue
Block a user