Skip to content

Commit f8d7be5

Browse files
authored
Add content_type to Attachment
1 parent 5b244a7 commit f8d7be5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

discord/message.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,13 @@ class Attachment(Hashable):
111111
The proxy URL. This is a cached version of the :attr:`~Attachment.url` in the
112112
case of images. When the message is deleted, this URL might be valid for a few
113113
minutes or not valid at all.
114+
content_type: Optional[:class:`str`]
115+
The attachment's `media type <https://en.wikipedia.org/wiki/Media_type>`_
116+
117+
.. versionadded: 1.7
114118
"""
115119

116-
__slots__ = ('id', 'size', 'height', 'width', 'filename', 'url', 'proxy_url', '_http')
120+
__slots__ = ('id', 'size', 'height', 'width', 'filename', 'url', 'proxy_url', '_http', 'content_type')
117121

118122
def __init__(self, *, data, state):
119123
self.id = int(data['id'])
@@ -124,6 +128,7 @@ def __init__(self, *, data, state):
124128
self.url = data.get('url')
125129
self.proxy_url = data.get('proxy_url')
126130
self._http = state.http
131+
self.content_type = data.get('content_type')
127132

128133
def is_spoiler(self):
129134
""":class:`bool`: Whether this attachment contains a spoiler."""

0 commit comments

Comments
 (0)