aboutsummaryrefslogtreecommitdiff
path: root/discord
diff options
context:
space:
mode:
authorZomatree <[email protected]>2021-04-04 04:26:28 +0100
committerGitHub <[email protected]>2021-04-03 23:26:28 -0400
commitf8d7be5b78c0eee43dd4440e805798093e34adc7 (patch)
treed58188e7735daeb016143ef5f3e030895f4eeb5b /discord
parentAdd changelog for v1.7 (diff)
downloaddiscord.py-f8d7be5b78c0eee43dd4440e805798093e34adc7.tar.xz
discord.py-f8d7be5b78c0eee43dd4440e805798093e34adc7.zip
Add content_type to Attachment
Diffstat (limited to 'discord')
-rw-r--r--discord/message.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/discord/message.py b/discord/message.py
index f85b0bb6..cebbb3bb 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 <https://en.wikipedia.org/wiki/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."""