diff options
| author | Rapptz <[email protected]> | 2016-03-25 18:30:42 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2016-03-25 18:30:42 -0400 |
| commit | 2ef38107d8f8bd035bd39097a3a74275cef16dd5 (patch) | |
| tree | 4076632b6cf5e77c8c2729d3309b38e6b6c5f102 /discord/channel.py | |
| parent | [commands] Add bot decorators into __all__. (diff) | |
| download | discord.py-2ef38107d8f8bd035bd39097a3a74275cef16dd5.tar.xz discord.py-2ef38107d8f8bd035bd39097a3a74275cef16dd5.zip | |
Add missing created_at properties for other objects.
Such as Channel, PrivateChannel, Object and Role.
Diffstat (limited to 'discord/channel.py')
| -rw-r--r-- | discord/channel.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/discord/channel.py b/discord/channel.py index 8f718fbe..11f6b722 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -143,6 +143,11 @@ class Channel(Hashable): """str : The string that allows you to mention the channel.""" return '<#{0.id}>'.format(self) + @property + def created_at(self): + """Returns the channel's creation time in UTC.""" + return utils.snowflake_time(self.id) + def permissions_for(self, member): """Handles permission resolution for the current :class:`Member`. @@ -255,6 +260,11 @@ class PrivateChannel(Hashable): def __str__(self): return 'Direct Message with {0.name}'.format(self.user) + @property + def created_at(self): + """Returns the private channel's creation time in UTC.""" + return utils.snowflake_time(self.id) + def permissions_for(self, user): """Handles permission resolution for a :class:`User`. |