aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve C <[email protected]>2020-12-06 00:59:20 -0800
committerGitHub <[email protected]>2020-12-06 03:59:20 -0500
commit6e6a3bed1a2803d39e11747fe829502e429af5ae (patch)
tree970f5160ea0338abd121ae8ce5aaa5e44ce7a328
parent[commands] Cog unload failures are swallowed. (diff)
downloaddiscord.py-6e6a3bed1a2803d39e11747fe829502e429af5ae.tar.xz
discord.py-6e6a3bed1a2803d39e11747fe829502e429af5ae.zip
Add created_at property to PartialEmoji
Also fixed docstring for PartialEmoji.url
-rw-r--r--discord/partial_emoji.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/discord/partial_emoji.py b/discord/partial_emoji.py
index 1eebf5da..346ccafe 100644
--- a/discord/partial_emoji.py
+++ b/discord/partial_emoji.py
@@ -137,8 +137,19 @@ class PartialEmoji(_EmojiTag):
return '%s:%s' % (self.name, self.id)
@property
+ def created_at(self):
+ """Optional[:class:`datetime.datetime`]: Returns the emoji's creation time in UTC, or None if Unicode emoji.
+
+ .. versionadded:: 1.6
+ """
+ if self.is_unicode_emoji():
+ return None
+
+ return utils.snowflake_time(self.id)
+
+ @property
def url(self):
- """:class:`Asset`:Returns an asset of the emoji, if it is custom."""
+ """:class:`Asset`: Returns an asset of the emoji, if it is custom."""
if self.is_unicode_emoji():
return Asset(self._state)