aboutsummaryrefslogtreecommitdiff
path: root/discord/object.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2016-03-25 18:30:42 -0400
committerRapptz <[email protected]>2016-03-25 18:30:42 -0400
commit2ef38107d8f8bd035bd39097a3a74275cef16dd5 (patch)
tree4076632b6cf5e77c8c2729d3309b38e6b6c5f102 /discord/object.py
parent[commands] Add bot decorators into __all__. (diff)
downloaddiscord.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/object.py')
-rw-r--r--discord/object.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/discord/object.py b/discord/object.py
index 096d240c..2bf2d495 100644
--- a/discord/object.py
+++ b/discord/object.py
@@ -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)