Add missing created_at properties for other objects.

Such as Channel, PrivateChannel, Object and Role.
This commit is contained in:
Rapptz
2016-03-25 18:30:42 -04:00
parent 050c668eac
commit 2ef38107d8
3 changed files with 23 additions and 0 deletions

View File

@ -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`.