aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--discord/ext/commands/context.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/discord/ext/commands/context.py b/discord/ext/commands/context.py
index 7413eead..01361821 100644
--- a/discord/ext/commands/context.py
+++ b/discord/ext/commands/context.py
@@ -115,3 +115,10 @@ class Context:
ret = yield from command.callback(*arguments, **kwargs)
return ret
+ @property
+ def cog(self):
+ """Returns the cog associated with this context's command. None if it does not exist."""
+
+ if self.command is None:
+ return None
+ return self.command.instance