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

@ -23,6 +23,8 @@ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
"""
from .utils import snowflake_time
class Object:
"""Represents a generic Discord object.
@ -45,3 +47,8 @@ class Object:
def __init__(self, id):
self.id = id
@property
def created_at(self):
"""Returns the private channel's creation time in UTC."""
return utils.snowflake_time(self.id)