mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-20 16:00:29 +00:00
[commands] Add Context.cog property.
This commit is contained in:
parent
2ebc0ab218
commit
183e7341f6
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user