aboutsummaryrefslogtreecommitdiff
path: root/discord/ext/commands/help.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2019-04-06 21:33:21 -0400
committerRapptz <[email protected]>2019-04-06 21:33:21 -0400
commitee81f0614e1182e071b59557e1c50e25ce9cc713 (patch)
tree3ce7b2f2ba83e89242fef8e1fce1f5d00b2ba3f7 /discord/ext/commands/help.py
parentSimplify bot loop cleanup routine. (diff)
downloaddiscord.py-ee81f0614e1182e071b59557e1c50e25ce9cc713.tar.xz
discord.py-ee81f0614e1182e071b59557e1c50e25ce9cc713.zip
[commands] Fix HelpCommand.invoked_with when used in events.
Diffstat (limited to 'discord/ext/commands/help.py')
-rw-r--r--discord/ext/commands/help.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/discord/ext/commands/help.py b/discord/ext/commands/help.py
index 686d21f1..bfc506d4 100644
--- a/discord/ext/commands/help.py
+++ b/discord/ext/commands/help.py
@@ -330,9 +330,10 @@ class HelpCommand:
The command name that triggered this invocation.
"""
command_name = self._command_impl.name
- if self.context is None or self.context.command.qualified_name != command_name:
+ ctx = self.context
+ if ctx is None or or ctx.command is None or ctx.command.qualified_name != command_name:
return command_name
- return self.context.invoked_with
+ return ctx.invoked_with
def get_command_signature(self, command):
"""Retrieves the signature portion of the help page.