diff --git a/discord/message.py b/discord/message.py index f85b0bb69..cebbb3bbe 100644 --- a/discord/message.py +++ b/discord/message.py @@ -111,9 +111,13 @@ class Attachment(Hashable): The proxy URL. This is a cached version of the :attr:`~Attachment.url` in the case of images. When the message is deleted, this URL might be valid for a few minutes or not valid at all. + content_type: Optional[:class:`str`] + The attachment's `media type `_ + + .. versionadded: 1.7 """ - __slots__ = ('id', 'size', 'height', 'width', 'filename', 'url', 'proxy_url', '_http') + __slots__ = ('id', 'size', 'height', 'width', 'filename', 'url', 'proxy_url', '_http', 'content_type') def __init__(self, *, data, state): self.id = int(data['id']) @@ -124,6 +128,7 @@ class Attachment(Hashable): self.url = data.get('url') self.proxy_url = data.get('proxy_url') self._http = state.http + self.content_type = data.get('content_type') def is_spoiler(self): """:class:`bool`: Whether this attachment contains a spoiler."""