
    cjhx                        d Z ddlmZ ddlZddlmZmZmZmZ ddl	m
Z
 ddlmZ dZ ed	d
      ZerddlmZ ddlmZ  G d d      Z G d d      Z G d d      Z G d d      Z G d d      Z G d d
      Zy)ae  
The MIT License (MIT)

Copyright (c) 2015-2021 Rapptz
Copyright (c) 2021-present Pycord Development

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
    )annotationsN)TYPE_CHECKINGAnyMappingTypeVar   )utils)Colour)Embed
EmbedFieldEmbedAuthorEmbedFooter
EmbedMediaEmbedProviderEr   )bound)r   )	EmbedTypec                  V    e Zd ZdZ	 	 d	 	 	 	 	 	 	 d	dZed
d       ZddZddZddZ	y)r   a  Represents the author on the :class:`Embed` object.

    .. versionadded:: 2.5

    Attributes
    ----------
    name: :class:`str`
        The name of the author.
    url: :class:`str`
        The URL of the hyperlink created in the author's name.
    icon_url: :class:`str`
        The URL of the author icon image.
    proxy_icon_url: :class:`str`
        The proxied URL of the author icon image. This can't be set directly, it is set by Discord.
    Nc                <    || _         || _        || _        d | _        y N)nameurlicon_urlproxy_icon_urlselfr   r   r   s       A/var/www/html/venv/lib/python3.12/site-packages/discord/embeds.py__init__zEmbedAuthor.__init__D   s!     	"$,*.    c                    | j                  |       }|j                  d      }|st        d      ||_        |j                  d      |_        |j                  d      |_        |j                  d      |_        |S )Nr   zname field is requiredr   r   r   )__new__get
ValueErrorr   r   r   r   )clsdatar   r   s       r   	from_dictzEmbedAuthor.from_dictO   sj    {{3xx566	88E?,"hh'78r   c                    dt        | j                        i}| j                  rt        | j                        |d<   | j                  rt        | j                        |d<   |S )Nr   r   r   )strr   r   r   r   ds     r   to_dictzEmbedAuthor.to_dict[   sJ    S^$88488}AeH==.AjMr   c                ,    t        | j                        S )z:Returns the total number of characters in the author name.)lenr   r   s    r   __len__zEmbedAuthor.__len__c       499~r   c                V    d| j                   d| j                  d| j                  dS )Nz<EmbedAuthor name= url=
 icon_url=>)r   r   r   r.   s    r   __repr__zEmbedAuthor.__repr__g   s+    #DII=dhh\DMMK\\]^^r   )NN)r   r(   r   
str | Noner   r6   returnNone)r%   dict[str, str | None]r7   r   )r7   zdict[str, str]r7   intr7   r(   
__name__
__module____qualname____doc__r   classmethodr&   r+   r/   r5    r   r   r   r   3   s^    & #		/	/ 	/ 		/
 
	/ 	 	_r   r   c                  P    e Zd ZdZ	 d	 	 	 	 	 d	dZed
d       ZddZddZddZ	y)r   av  Represents the footer on the :class:`Embed` object.

    .. versionadded:: 2.5

    Attributes
    ----------
    text: :class:`str`
       The text inside the footer.
    icon_url: :class:`str`
        The URL of the footer icon image.
    proxy_icon_url: :class:`str`
        The proxied URL of the footer icon image. This can't be set directly, it is set by Discord.
    Nc                .    || _         || _        d | _        y r   )textr   r   r   rF   r   s      r   r   zEmbedFooter.__init__z   s    
 	$,*.r   c                    | j                  |       }|j                  d      }|st        d      ||_        |j                  d      |_        |j                  d      |_        |S )NrF   ztext field is requiredr   r   )r!   r"   r#   rF   r   r   )r$   r%   r   rF   s       r   r&   zEmbedFooter.from_dict   s[    {{3xx566	,"hh'78r   c                |    dt        | j                        i}| j                  rt        | j                        |d<   |S )NrF   r   )r(   rF   r   r)   s     r   r+   zEmbedFooter.to_dict   s2    S^$==.AjMr   c                ,    t        | j                        S )z:Returns the total number of characters in the footer text.)r-   rF   r.   s    r   r/   zEmbedFooter.__len__   r0   r   c                <    d| j                   d| j                  dS )Nz<EmbedFooter text=r3   r4   rF   r   r.   s    r   r5   zEmbedFooter.__repr__   s     #DII=
4==:K1MMr   r   )rF   r(   r   r6   r7   r8   )r%   r9   r7   r   )r7   zdict[str, Any]r:   r<   r=   rC   r   r   r   r   k   sQ    "  $// / 
	/  Nr   r   c                  \    e Zd ZU dZded<   ded<   ded<   ded<   dd	Zedd
       ZddZy)r   a  Represents a media on the :class:`Embed` object.
    This includes thumbnails, images, and videos.

    .. versionadded:: 2.5

    Attributes
    ----------
    url: :class:`str`
        The source URL of the media.
    proxy_url: :class:`str`
        The proxied URL of the media.
    height: :class:`int`
        The height of the media.
    width: :class:`int`
        The width of the media.
    r(   r   r6   	proxy_urlz
int | Noneheightwidthc                <    || _         d | _        d | _        d | _        y r   r   rN   rO   rP   r   r   s     r   r   zEmbedMedia.__init__   s    
r   c                R   | j                  |       }t        |j                  d            |_        |j                  d      x}rt        |      nd |_        |j                  d      x}rt        |      nd |_        |j                  d      x}rt        |      |_        |S d |_        |S )Nr   rN   rO   rP   )r!   r(   r"   r   rN   r;   rO   rP   )r$   r%   r   rN   rO   rP   s         r   r&   zEmbedMedia.from_dict   s    {{3txx',0HH[,AAyAC	N 	 150B&Bf&Bc&k-1XXg->$>E$>SZ
 FJ
r   c           	     p    d| j                   d| j                  d| j                  d| j                  d	S )Nz<EmbedMedia url=z proxy_url=z	> height=z width=r4   rR   r.   s    r   r5   zEmbedMedia.__repr__   s>    !$(([8J)TXT_T_Sbbijnjtjtiwwxyyr   N)r   r(   )r%   zdict[str, str | int]r7   r   r<   )	r>   r?   r@   rA   __annotations__r   rB   r&   r5   rC   r   r   r   r      s?    " 
H  zr   r   c                  @    e Zd ZU dZded<   ded<   edd       Zd	dZy)
r   zRepresents a provider on the :class:`Embed` object.

    .. versionadded:: 2.5

    Attributes
    ----------
    name: :class:`str`
        The name of the provider.
    url: :class:`str`
        The URL of the provider.
    r6   r   r   c                    | j                  |       }|j                  d      |_        |j                  d      |_        |S )Nr   r   )r!   r"   r   r   r$   r%   r   s      r   r&   zEmbedProvider.from_dict   s4    {{3HHV$	88E?r   c                <    d| j                   d| j                  dS )Nz<EmbedProvider name=r2   r4   )r   r   r.   s    r   r5   zEmbedProvider.__repr__   s    %dii]%|1EEr   N)r%   r9   r7   r   r<   )r>   r?   r@   rA   rV   rB   r&   r5   rC   r   r   r   r      s,    
 	O Fr   r   c                  <    e Zd ZdZdddZed	d       Zd
dZddZy)r   a-  Represents a field on the :class:`Embed` object.

    .. versionadded:: 2.0

    Attributes
    ----------
    name: :class:`str`
        The name of the field.
    value: :class:`str`
        The value of the field.
    inline: :class:`bool`
        Whether the field should be displayed inline.
    c                .    || _         || _        || _        y r   r   valueinliner   r   r^   r_   s       r   r   zEmbedField.__init__   s    	
r   c                ~    | j                  |       }|d   |_        |d   |_        |j                  dd      |_        |S )a  Converts a :class:`dict` to a :class:`EmbedField` provided it is in the
        format that Discord expects it to be in.

        You can find out about this format in the `official Discord documentation`__.

        .. _DiscordDocsEF: https://discord.com/developers/docs/resources/channel#embed-object-embed-field-structure

        __ DiscordDocsEF_

        Parameters
        ----------
        data: :class:`dict`
            The dictionary to convert into an EmbedField object.
        r   r^   r_   F)r!   r   r^   r"   r_   rY   s      r   r&   zEmbedField.from_dict   s?      {{3L	']
hhx/r   c                J    | j                   | j                  | j                  dS )zConverts this EmbedField object into a dict.

        Returns
        -------
        Dict[:class:`str`, Union[:class:`str`, :class:`bool`]]
            A dictionary of :class:`str` embed field keys bound to the respective value.
        r]   r]   r.   s    r   r+   zEmbedField.to_dict  s#     IIZZkk
 	
r   c                V    d| j                   d| j                  d| j                  dS )Nz<EmbedField name=z value=z inline=r4   r]   r.   s    r   r5   zEmbedField.__repr__  s*    "499-wtzznHT[[O[\]]r   N)F)r   r(   r^   r(   r_   zbool | None)r%   zdict[str, str | bool]r7   r   )r7   zdict[str, str | bool | None]r<   )	r>   r?   r@   rA   r   rB   r&   r+   r5   rC   r   r   r   r      s+    
  .
^r   r   c                  &   e Zd ZdZdZddddddddddddd	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d.dZed/d       Zd0dZd1d	Z	d2d
Z
ed3d       Zej                  d4d       ZeZed5d       Zej                  d6d       Zed7d       Zej                  d8d       Zddd	 	 	 	 	 	 	 d9dZd0dZed:d       Zej                  d;d       Zd<dZd0dZed:d       Zej                  d;d       Zd<dZd0dZed:d       Zed=d       Zed>d       Zej                  d?d       Zddd 	 	 	 	 	 	 	 	 	 d@d!Zd0d"ZedAd#       Zej                  dBd$       ZdCd%Zd&d'dDd(Z d&d'	 	 	 	 	 	 	 	 	 	 	 dEd)Z!dFd*Z"dGd+Z#d&d'	 	 	 	 	 	 	 	 	 	 	 dEd,Z$dHd-Z%y)Ir   a  Represents a Discord embed.

    .. container:: operations

        .. describe:: len(x)

            Returns the total size of the embed.
            Useful for checking if it's within the 6000 character limit.

        .. describe:: bool(b)

            Returns whether the embed has any data set.

            .. versionadded:: 2.0

    For ease of use, all parameters that expect a :class:`str` are implicitly
    cast to :class:`str` for you.

    Attributes
    ----------
    title: :class:`str`
        The title of the embed.
        This can be set during initialisation.
        Must be 256 characters or fewer.
    type: :class:`str`
        The type of embed. Usually "rich".
        This can be set during initialisation.
        Possible strings for embed types can be found on discord's
        `api docs <https://discord.com/developers/docs/resources/channel#embed-object-embed-types>`_
    description: :class:`str`
        The description of the embed.
        This can be set during initialisation.
        Must be 4096 characters or fewer.
    url: :class:`str`
        The URL of the embed.
        This can be set during initialisation.
    timestamp: :class:`datetime.datetime`
        The timestamp of the embed content. This is an aware datetime.
        If a naive datetime is passed, it is converted to an aware
        datetime with the local timezone.
    colour: Union[:class:`Colour`, :class:`int`]
        The colour code of the embed. Aliased to ``color`` as well.
        This can be set during initialisation.
    )titler   type
_timestamp_colour_footer_image
_thumbnail_video	_provider_author_fieldsdescriptionNrich)colourcolorre   rf   r   rp   	timestampfieldsauthorfooterimage	thumbnailc                  |r|n|| _         || _        || _        || _        || _        | j                  rt        | j                        | _        | j                  rt        | j                        | _        | j                  rt        | j                        | _        |r|| _        ||ng | _        |	| _        |
| _	        || _
        || _        y r   )rr   re   rf   r   rp   r(   rt   ro   rv   rw   rx   ry   )r   rr   rs   re   rf   r   rp   rt   ru   rv   rw   rx   ry   s                r   r   zEmbed.__init___  s      !'fE
	&::TZZDJ"4#3#34D88488}DH&DN393E2
"r   c                P   | j                  |       }|j                  dd      |_        |j                  dd      |_        |j                  dd      |_        |j                  dd      |_        |j                  rt        |j                        |_        |j                  rt        |j                        |_        |j
                  rt        |j
                        |_        	 t        |d         |_        	 t        j                  |d         |_        d	D ]\  }|d
k(  r?|j                  |g       }|r#|D cg c]  }t        j                  |       c}ng |_        G	 ||   }t!        |d| |       ^ |S # t        $ r Y w xY w# t        $ r Y }w xY wc c}w # t        $ r Y w xY w)a!  Converts a :class:`dict` to a :class:`Embed` provided it is in the
        format that Discord expects it to be in.

        You can find out about this format in the `official Discord documentation`__.

        .. _DiscordDocs: https://discord.com/developers/docs/resources/channel#embed-object

        __ DiscordDocs_

        Parameters
        ----------
        data: :class:`dict`
            The dictionary to convert into an embed.

        Returns
        -------
        :class:`Embed`
            The converted embed object.
        re   Nrf   rp   r   rs   r^   rt   )ry   videoproviderrv   ru   rx   rw   ru   _)r!   r"   re   rf   rp   r   r(   r
   rh   KeyErrorr	   
parse_timerg   r   r&   ro   setattr)r$   r%   r   attrr^   r*   s         r   r&   zEmbed.from_dict  s   , ++c" XXgt,
HHVT*	88M4888E4(::TZZDJ"4#3#34D88488}DH	!W6DL	#..tK/@ADO
 	5D xr*KPGA
 4 4Q 7GVX5 JE DAdV*e4%	5( 9  		
  		  H   s<   !E6 6F 5FF6	FF	FF	F%$F%c                T    | j                   j                  | j                               S )zCreates a shallow copy of the :class:`Embed` object.

        Returns
        -------
        :class:`Embed`
            The copied embed object.
        )	__class__r&   r+   r.   s    r   copyz
Embed.copy  s     ~~''77r   c                   d}| j                   r|t        | j                         z  }| j                  r|t        | j                        z  }t        | dg       D ]0  }|t        |j                        t        |j
                        z   z  }2 	 | j                  d   }|t        |      z  }	 | j                  }|t        |d         z  }|S # t        t        f$ r Y 1w xY w# t        $ r Y |S w xY w)Nr   ro   rF   r   )
re   r-   rp   getattrr   r^   ri   AttributeErrorr   rn   )r   totalfieldfooter_textrv   s        r   r/   zEmbed.__len__  s    ::S_$ES))**ET9b1 	8ES_s5;;'777E	8	&,,v.K S%%E	)\\F S((E ) 		  	 	s$   C	 *C 	CC	C+*C+c                    t        | j                  | j                  | j                  | j                  | j
                  | j                  | j                  | j                  | j                  | j                  | j                  | j                  f      S r   )anyre   r   rp   rr   ru   rt   rv   ry   rw   rx   r~   r}   r.   s    r   __bool__zEmbed.__bool__  sj    

  




 	
r   c                    t        | dd       S )Nrh   r   r.   s    r   rr   zEmbed.colour  s    tY--r   c                    |t        |t              r|| _        y t        |t              rt        |      | _        y t	        d|j
                  j                   d      )Nr|   z3Expected discord.Colour, int, or None but received 	 instead.)
isinstancer
   rh   r;   	TypeErrorr   r>   r   r^   s     r   rr   zEmbed.colour  sV    =Juf5 DLs#!.DLOO,,-Y8 r   c                    t        | dd       S )Nrg   r   r.   s    r   rt   zEmbed.timestamp  s    t\400r   c                    t        |t        j                        r$|j                  |j                         }|| _        y ||| _        y t        d|j                  j                   d      )Nz-Expected datetime.datetime or None. Received  instead)r   datetimetzinfo
astimezonerg   r   r   r>   r   s     r   rt   zEmbed.timestamp  sf    eX../||#((*#DO]#DOOO,,-X7 r   c                L    t        | dd      }|syt        j                  |      S )zReturns an :class:`EmbedFooter` denoting the footer contents.

        See :meth:`set_footer` for possible values you can access.

        If the footer is not set then `None` is returned.
        ri   N)r   r   r&   )r   foots     r   rw   zEmbed.footer+  )     tY-$$T**r   c                    || j                          y t        |t              r|j                         | _        y t        d|j                  j                   d      )Nz'Expected EmbedFooter or None. Received r   )remove_footerr   r   r+   ri   r   r   r>   r   s     r   rw   zEmbed.footer8  sS    = {+ ==?DLOO,,-X7 r   rL   c               |    i | _         |rt        |      | j                   d<   |rt        |      | j                   d<   | S )a|  Sets the footer for the embed content.

        This function returns the class instance to allow for fluent-style
        chaining.

        Parameters
        ----------
        text: :class:`str`
            The footer text.
            Must be 2048 characters or fewer.
        icon_url: :class:`str`
            The URL of the footer icon. Only HTTP(S) is supported.
        rF   r   )ri   r(   rG   s      r   
set_footerzEmbed.set_footerD  s:    ( #&t9DLL '*8}DLL$r   c                ,    	 | ` | S # t        $ r Y | S w xY w)zClears embed's footer information.

        This function returns the class instance to allow for fluent-style
        chaining.

        .. versionadded:: 2.0
        )ri   r   r.   s    r   r   zEmbed.remove_footera  ,    	   		    	c                L    t        | dd      }|syt        j                  |      S )zReturns an :class:`EmbedMedia` denoting the image contents.

        Attributes you can access are:

        - ``url``
        - ``proxy_url``
        - ``width``
        - ``height``

        If the image is not set then `None` is returned.
        rj   Nr   r   r&   )r   imgs     r   rx   zEmbed.imagep  s)     dHd+##C((r   c                   || j                          y t        |t              r| j                  |       y t        |t              r| j                  |j
                         y t        d|j                  j                   d      N)r   z2Expected discord.EmbedMedia, or None but received r   )	remove_imager   r(   	set_imager   r   r   r   r>   r   s     r   rx   zEmbed.image  sp    =s#NNuN%z*NNuyyN)OO,,-Y8 r   c               X    |	 | ` | S dt        |      i| _         | S # t        $ r Y | S w xY w)aa  Sets the image for the embed content.

        This function returns the class instance to allow for fluent-style
        chaining.

        .. versionchanged:: 1.4
            Passing `None` removes the image.

        Parameters
        ----------
        url: :class:`str`
            The source URL for the image. Only HTTP(S) is supported.
        r   )rj   r   r(   rS   s     r   r   zEmbed.set_image  sP     ;K  s3xDK  "      	))c                ,    	 | ` | S # t        $ r Y | S w xY w)zRemoves the embed's image.

        This function returns the class instance to allow for fluent-style
        chaining.

        .. versionadded:: 2.0
        )rj   r   r.   s    r   r   zEmbed.remove_image  s,    	   		r   c                L    t        | dd      }|syt        j                  |      S )a  Returns an :class:`EmbedMedia` denoting the thumbnail contents.

        Attributes you can access are:

        - ``url``
        - ``proxy_url``
        - ``width``
        - ``height``

        If the thumbnail is not set then `None` is returned.
        rk   Nr   )r   thumbs     r   ry   zEmbed.thumbnail  s)     lD1##E**r   c                   || j                          y t        |t              r| j                  |       y t        |t              r| j                  |j
                         y t        d|j                  j                   d      r   )	remove_thumbnailr   r(   set_thumbnailr   r   r   r   r>   r   s     r   ry   zEmbed.thumbnail  sv    =!!#s#5)z*599-OO,,-Y8 r   c               X    |	 | ` | S dt        |      i| _         | S # t        $ r Y | S w xY w)am  Sets the thumbnail for the embed content.

        This function returns the class instance to allow for fluent-style
        chaining.

        .. versionchanged:: 1.4
            Passing `None` removes the thumbnail.

        Parameters
        ----------
        url: :class:`str`
            The source URL for the thumbnail. Only HTTP(S) is supported.
        r   )rk   r   r(   rS   s     r   r   zEmbed.set_thumbnail  sP     ;O  s3xDO  "  r   c                ,    	 | ` | S # t        $ r Y | S w xY w)zRemoves the embed's thumbnail.

        This function returns the class instance to allow for fluent-style
        chaining.

        .. versionadded:: 2.0
        )rk   r   r.   s    r   r   zEmbed.remove_thumbnail  s,    	   		r   c                L    t        | dd      }|syt        j                  |      S )a  Returns an :class:`EmbedMedia` denoting the video contents.

        Attributes include:

        - ``url`` for the video URL.
        - ``height`` for the video height.
        - ``width`` for the video width.

        If the video is not set then `None` is returned.
        rl   Nr   )r   vids     r   r}   zEmbed.video  s)     dHd+##C((r   c                L    t        | dd      }|syt        j                  |      S )zReturns an :class:`EmbedProvider` denoting the provider contents.

        The only attributes that might be accessed are ``name`` and ``url``.

        If the provider is not set then `None` is returned.
        rm   N)r   r   r&   )r   provs     r   r~   zEmbed.provider  s)     t[$/&&t,,r   c                L    t        | dd      }|syt        j                  |      S )zReturns an :class:`EmbedAuthor` denoting the author contents.

        See :meth:`set_author` for possible values you can access.

        If the author is not set then `None` is returned.
        rn   N)r   r   r&   )r   auths     r   rv   zEmbed.author"  r   r   c                    || j                          y t        |t              r|j                         | _        y t        d|j                  j                   d      )Nz3Expected discord.EmbedAuthor, or None but received r   )remove_authorr   r   r+   rn   r   r   r>   r   s     r   rv   zEmbed.author/  sS    = {+ ==?DLOO,,-Y8 r   )r   r   c                   dt        |      i| _        |rt        |      | j                  d<   |rt        |      | j                  d<   | S )a  Sets the author for the embed content.

        This function returns the class instance to allow for fluent-style
        chaining.

        Parameters
        ----------
        name: :class:`str`
            The name of the author.
            Must be 256 characters or fewer.
        url: :class:`str`
            The URL for the author.
        icon_url: :class:`str`
            The URL of the author icon. Only HTTP(S) is supported.
        r   r   r   )r(   rn   r   s       r   
set_authorzEmbed.set_author;  sG    0 CI
 "%c(DLL'*8}DLL$r   c                ,    	 | ` | S # t        $ r Y | S w xY w)zClears embed's author information.

        This function returns the class instance to allow for fluent-style
        chaining.

        .. versionadded:: 1.4
        )rn   r   r.   s    r   r   zEmbed.remove_author^  r   r   c                    | j                   S )zReturns a :class:`list` of :class:`EmbedField` objects denoting the field contents.

        See :meth:`add_field` for possible values you can access.

        If the attribute has no value then ``None`` is returned.
        )ro   r.   s    r   ru   zEmbed.fieldsm  s     ||r   c                L    t        d |D              st        d      || _        y)zSets the fields for the embed. This overwrites any existing fields.

        Parameters
        ----------
        value: List[:class:`EmbedField`]
            The list of :class:`EmbedField` objects to include in the embed.
        c              3  <   K   | ]  }t        |t                y wr   )r   r   ).0xs     r   	<genexpr>zEmbed.fields.<locals>.<genexpr>  s     <:a,<s   z&Expected a list of EmbedField objects.N)allr   ro   r   s     r   ru   zEmbed.fieldsw  s%     <e<<DEEr   c                p    t        |t              st        d      | j                  j	                  |       y)zAppends an :class:`EmbedField` object to the embed.

        .. versionadded:: 2.0

        Parameters
        ----------
        field: :class:`EmbedField`
            The field to add.
        zExpected an EmbedField object.N)r   r   r   ro   append)r   r   s     r   append_fieldzEmbed.append_field  s,     %,<==E"r   T)r_   c               x    | j                   j                  t        t        |      t        |      |             | S )a  Adds a field to the embed object.

        This function returns the class instance to allow for fluent-style
        chaining. There must be 25 fields or fewer.

        Parameters
        ----------
        name: :class:`str`
            The name of the field.
            Must be 256 characters or fewer.
        value: :class:`str`
            The value of the field.
            Must be 1024 characters or fewer.
        inline: :class:`bool`
            Whether the field should be displayed inline.
        r]   )ro   r   r   r(   r`   s       r   	add_fieldzEmbed.add_field  s-    " 	JCISZPVWXr   c               ~    t        t        |      t        |      |      }| j                  j                  ||       | S )a  Inserts a field before a specified index to the embed.

        This function returns the class instance to allow for fluent-style
        chaining. There must be 25 fields or fewer.

        .. versionadded:: 1.2

        Parameters
        ----------
        index: :class:`int`
            The index of where to insert the field.
        name: :class:`str`
            The name of the field.
            Must be 256 characters or fewer.
        value: :class:`str`
            The value of the field.
            Must be 1024 characters or fewer.
        inline: :class:`bool`
            Whether the field should be displayed inline.
        r]   )r   r(   ro   insertr   indexr   r^   r_   r   s         r   insert_field_atzEmbed.insert_field_at  s3    0 D	UFKE5)r   c                8    | j                   j                          y)z#Removes all fields from this embed.N)ro   clearr.   s    r   clear_fieldszEmbed.clear_fields  s    r   c                >    	 | j                   |= y# t        $ r Y yw xY w)a  Removes a field at a specified index.

        If the index is invalid or out of bounds then the error is
        silently swallowed.

        .. note::

            When deleting a field by index, the index of the other fields
            shift to fill the gap just like a regular list.

        Parameters
        ----------
        index: :class:`int`
            The index of the field to remove.
        N)ro   
IndexError)r   r   s     r   remove_fieldzEmbed.remove_field  s%     	U# 		s    	c                   	 | j                   |   }t        |      |_        t        |      |_        ||_        | S # t        t        f$ r t        d      w xY w)a  Modifies a field to the embed object.

        The index must point to a valid pre-existing field. There must be 25 fields or fewer.

        This function returns the class instance to allow for fluent-style
        chaining.

        Parameters
        ----------
        index: :class:`int`
            The index of the field to modify.
        name: :class:`str`
            The name of the field.
            Must be 256 characters or fewer.
        value: :class:`str`
            The value of the field.
            Must be 1024 characters or fewer.
        inline: :class:`bool`
            Whether the field should be displayed inline.

        Raises
        ------
        IndexError
            An invalid index was provided.
        zfield index out of range)ro   r   r   r(   r   r^   r_   r   s         r   set_field_atzEmbed.set_field_at  s[    :	9LL'E Y
%j :& 	9788	9s	   : Ac                ~   | j                   D ci c]+  }|dk7  r$|d   dk(  rt        | |      r|dd t        | |      - }}| j                  D cg c]  }|j	                          c}|d<   	 |j                  d      }|r|j                  |d<   	 	 |j                  d	      }|r|j                  r<|j                  t        j                  j                  
      j                         |d	<   n<|j                  t        j                  j                        j                         |d	<   	 | j                  r| j                  |d<   | j                   r| j                   |d<   | j"                  r| j"                  |d<   | j$                  r| j$                  |d<   |S c c}w c c}w # t        $ r Y w xY w# t        $ r Y w xY w)zConverts this embed object into a dict.

        Returns
        -------
        Dict[:class:`str`, Union[:class:`str`, :class:`int`, :class:`bool`]]
            A dictionary of :class:`str` embed keys bound to the respective value.
        ro   r   r   r   Nru   rr   rs   rt   )tz)r   rf   rp   r   re   )	__slots__hasattrr   ro   r+   popr^   r   r   r   r   timezoneutc	isoformatreplacerf   rp   r   re   )r   keyresultr   rr   rt   s         r   r+   zEmbed.to_dict  s    ~~
iCFcMgdC6H GWT3''
 
 :>FEMMOFx	/ZZ)F "(,,w	"

;/I ##*3*>*>#,,00 +? +ik ;' +4*;*;'0044 +< +ik ;'
 99!YYF6N$($4$4F=!88 HHF5M::"jjF7O_
 G  		  		s/   0FF-F  F0  	F-,F-0	F<;F<)rr   int | Colour | Noners   r   re   
Any | Nonerf   r   r   r   rp   r   rt   datetime.datetime | Noneru   zlist[EmbedField] | Nonerv   EmbedAuthor | Nonerw   EmbedFooter | Nonerx   str | EmbedMedia | Nonery   r   )r$   ztype[E]r%   zMapping[str, Any]r7   r   )r   r   r7   r   r:   )r7   bool)r7   zColour | None)r^   r   )r7   r   )r^   r   )r7   r   )r^   r   )r   r   rF   r   r   r   r7   r   )r7   zEmbedMedia | None)r^   r   )r   r   r   r   r7   r   )r7   zEmbedProvider | None)r7   r   )r^   r   )
r   r   r   r   r   r   r   r   r7   r   )r7   list[EmbedField])r^   r   r7   r8   )r   r   r7   r8   )
r   r   r   r(   r^   r(   r_   r   r7   r   )r   r   r   r;   r   r   r^   r   r_   r   r7   r   )r7   r8   )r   r;   r7   r8   )r7   	EmbedData)&r>   r?   r@   rA   r   r   rB   r&   r   r/   r   propertyrr   setterrs   rt   rw   r   r   rx   r   r   ry   r   r   r}   r~   rv   r   r   ru   r   r   r   r   r   r   r+   rC   r   r   r   r   !  sf   +ZI& '+%)  "&.2*.%)%))--1'# $'# #	'#
 '# '# '#  '# ,'# ('# #'# #'# ''# +'#R G GR82
$ . . ]]	 	 E1 1   
+ 
+ ]]	 	  #	  	
 
: ) )" \\ 6 + +"  6 ) )  
- 
- 
+ 
+ ]]	 	 #!! ! 	!
 ! 
!F   ]] # EI , GK&)25?C	
<, GK%%%&)%25%?C%	
%N9r   )rA   
__future__r   r   typingr   r   r   r    r	   rr   r
   __all__r   discord.types.embedr   r   r   r   r   r   r   r   rC   r   r   <module>r      s   2 #  7 7   Cw6-5_ 5_p.N .Nb)z )zXF F6;^ ;^|_ _r   