From c089aa199b1a7937a0e84d6da428b4da284bc1db Mon Sep 17 00:00:00 2001 From: Rapptz Date: Tue, 14 Mar 2017 19:07:08 -0400 Subject: [PATCH] Remove Message.edited_timestamp in favour of Message.edited_at --- discord/message.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/discord/message.py b/discord/message.py index cec7647eb..ccb4fda9d 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