aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--discord/ext/commands/core.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py
index b5509530..e5c67c70 100644
--- a/discord/ext/commands/core.py
+++ b/discord/ext/commands/core.py
@@ -367,6 +367,11 @@ class Command:
def invoke(self, ctx):
self._verify_checks(ctx)
yield from self._parse_arguments(ctx)
+
+ # terminate the invoked_subcommand chain.
+ # since we're in a regular command (and not a group) then
+ # the invoked subcommand is None.
+ ctx.invoked_subcommand = None
injected = inject_context(ctx, self.callback)
yield from injected(*ctx.args, **ctx.kwargs)
@@ -593,8 +598,7 @@ class Group(GroupMixin, Command):
if trigger:
ctx.subcommand_passed = trigger
- if trigger in self.commands:
- ctx.invoked_subcommand = self.commands[trigger]
+ ctx.invoked_subcommand = self.commands.get(trigger, None)
if early_invoke:
injected = inject_context(ctx, self.callback)