From 2ef38107d8f8bd035bd39097a3a74275cef16dd5 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Fri, 25 Mar 2016 18:30:42 -0400 Subject: Add missing created_at properties for other objects. Such as Channel, PrivateChannel, Object and Role. --- discord/channel.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'discord/channel.py') 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`. -- cgit v1.2.3