diff --git a/discord/message.py b/discord/message.py index 30464bd8..d8757022 100644 --- a/discord/message.py +++ b/discord/message.py @@ -169,9 +169,14 @@ class Attachment(Hashable): The attachment's `media type `_ .. versionadded:: 1.7 + ephemeral: Optional[:class:`bool`] + If the attachment is ephemeral. Ephemeral attachments are temporary and + will automatically be removed after a set period of time. + + .. versionadded:: 2.0 """ - __slots__ = ("id", "size", "height", "width", "filename", "url", "proxy_url", "_http", "content_type") + __slots__ = ("id", "size", "height", "width", "filename", "url", "proxy_url", "ephemeral", "_http", "content_type") def __init__(self, *, data: AttachmentPayload, state: ConnectionState): self.id: int = int(data["id"]) @@ -183,6 +188,7 @@ class Attachment(Hashable): self.proxy_url: str = data.get("proxy_url") self._http = state.http self.content_type: Optional[str] = data.get("content_type") + self.ephemeral: Optional[bool] = data.get("ephemeral") def is_spoiler(self) -> bool: """:class:`bool`: Whether this attachment contains a spoiler.""" diff --git a/discord/types/message.py b/discord/types/message.py index 2522e839..6a6dc0bb 100644 --- a/discord/types/message.py +++ b/discord/types/message.py @@ -53,6 +53,7 @@ class _AttachmentOptional(TypedDict, total=False): height: Optional[int] width: Optional[int] content_type: str + ephemeral: bool spoiler: bool