aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2017-03-14 19:07:08 -0400
committerRapptz <[email protected]>2017-03-14 19:07:08 -0400
commitc089aa199b1a7937a0e84d6da428b4da284bc1db (patch)
tree608a0cf08cb2b9d4d016a660894d530e35e213c2
parentHandle aware datetimes in embeds. (diff)
downloaddiscord.py-c089aa199b1a7937a0e84d6da428b4da284bc1db.tar.xz
discord.py-c089aa199b1a7937a0e84d6da428b4da284bc1db.zip
Remove Message.edited_timestamp in favour of Message.edited_at
-rw-r--r--discord/message.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/discord/message.py b/discord/message.py
index cec7647e..ccb4fda9 100644
--- a/discord/message.py
+++ b/discord/message.py
@@ -46,8 +46,6 @@ class Message:
Attributes
-----------
- edited_timestamp: Optional[datetime.datetime]
- A naive UTC datetime object containing the edited time of the message.
tts: bool
Specifies if the message was done with text-to-speech.
type: :class:`MessageType`
@@ -111,7 +109,7 @@ class Message:
Reactions to a message. Reactions can be either custom emoji or standard unicode emoji.
"""
- __slots__ = ( 'edited_timestamp', 'tts', 'content', 'channel', 'webhook_id',
+ __slots__ = ( '_edited_timestamp', 'tts', 'content', 'channel', 'webhook_id',
'mention_everyone', 'embeds', 'id', 'mentions', 'author',
'_cs_channel_mentions', '_cs_raw_mentions', 'attachments',
'_cs_clean_content', '_cs_raw_channel_mentions', 'nonce', 'pinned',
@@ -172,7 +170,7 @@ class Message:
def _update(self, channel, data):
self.channel = channel
- self._try_patch(data, 'edited_timestamp', utils.parse_time)
+ self._edited_timestamp = utils.parse_time(data.get('edited_timestamp'))
self._try_patch(data, 'pinned', bool)
self._try_patch(data, 'mention_everyone', bool)
self._try_patch(data, 'tts', bool)
@@ -335,9 +333,14 @@ class Message:
@property
def created_at(self):
- """Returns the message's creation time in UTC."""
+ """datetime.datetime: The message's creation time in UTC."""
return utils.snowflake_time(self.id)
+ @property
+ def edited_at(self):
+ """Optional[datetime.datetime]: A naive UTC datetime object containing the edited time of the message."""
+ return self._edited_timestamp
+
@utils.cached_slot_property('_cs_system_content')
def system_content(self):
"""A property that returns the content that is rendered