2929
3030from . import utils
3131from .colour import Colour
32+ from .flags import AttachmentFlags , EmbedFlags
3233
3334# fmt: off
3435__all__ = (
@@ -76,6 +77,7 @@ class _EmbedMediaProxy(Protocol):
7677 proxy_url : Optional [str ]
7778 height : Optional [int ]
7879 width : Optional [int ]
80+ flags : Optional [AttachmentFlags ]
7981
8082 class _EmbedVideoProxy (Protocol ):
8183 url : Optional [str ]
@@ -146,6 +148,10 @@ class Embed:
146148 colour: Optional[Union[:class:`Colour`, :class:`int`]]
147149 The colour code of the embed. Aliased to ``color`` as well.
148150 This can be set during initialisation.
151+ flags: Optional[:class:`EmbedFlags`]
152+ The flags of this embed.
153+
154+ .. versionadded:: 2.5
149155 """
150156
151157 __slots__ = (
@@ -162,6 +168,7 @@ class Embed:
162168 '_author' ,
163169 '_fields' ,
164170 'description' ,
171+ 'flags' ,
165172 )
166173
167174 def __init__ (
@@ -181,6 +188,7 @@ def __init__(
181188 self .type : EmbedType = type
182189 self .url : Optional [str ] = url
183190 self .description : Optional [str ] = description
191+ self .flags : Optional [EmbedFlags ] = None
184192
185193 if self .title is not None :
186194 self .title = str (self .title )
@@ -245,6 +253,11 @@ def from_dict(cls, data: Mapping[str, Any]) -> Self:
245253 else :
246254 setattr (self , '_' + attr , value )
247255
256+ try :
257+ self .flags = EmbedFlags ._from_value (data ['flags' ])
258+ except KeyError :
259+ pass
260+
248261 return self
249262
250263 def copy (self ) -> Self :
@@ -399,11 +412,15 @@ def image(self) -> _EmbedMediaProxy:
399412 - ``proxy_url``
400413 - ``width``
401414 - ``height``
415+ - ``flags``
402416
403417 If the attribute has no value then ``None`` is returned.
404418 """
405419 # Lying to the type checker for better developer UX.
406- return EmbedProxy (getattr (self , '_image' , {})) # type: ignore
420+ data = getattr (self , '_image' , {})
421+ if 'flags' in data :
422+ data ['flags' ] = AttachmentFlags ._from_value (data ['flags' ])
423+ return EmbedProxy (data ) # type: ignore
407424
408425 def set_image (self , * , url : Optional [Any ]) -> Self :
409426 """Sets the image for the embed content.
0 commit comments