diff options
| author | Rapptz <[email protected]> | 2017-03-01 18:58:56 -0500 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2017-03-01 18:58:56 -0500 |
| commit | 98cfb53d3b15a50e7f4a8b4df287f82c76ae0b30 (patch) | |
| tree | 60429c604d30d268cf6f6fc09fe223a066000aa7 | |
| parent | Reconnect even if we close with 1000 since Discord can send it. (diff) | |
| download | discord.py-98cfb53d3b15a50e7f4a8b4df287f82c76ae0b30.tar.xz discord.py-98cfb53d3b15a50e7f4a8b4df287f82c76ae0b30.zip | |
[commands] Add Context.me property.
| -rw-r--r-- | discord/ext/commands/context.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/discord/ext/commands/context.py b/discord/ext/commands/context.py index f3b7bba2..36c2336c 100644 --- a/discord/ext/commands/context.py +++ b/discord/ext/commands/context.py @@ -152,3 +152,8 @@ class Context(discord.abc.Messageable): def author(self): """Returns the author associated with this context's command. Shorthand for :attr:`Message.author`""" return self.message.author + + @discord.utils.cached_property + def me(self): + """Similar to :attr:`Guild.me` except it may return the :class:`ClientUser` in private message contexts.""" + return self.guild.me if self.guild is not None else self.bot.user |