U
    g>                     @   s   d Z ddlmZmZmZmZmZ ddlmZ ddl	m
Z
 ddlmZ ddlmZ ddlmZ ddlmZ dd	lmZ dd
lmZ erddlmZ G dd de
ZG dd deZG dd deZdS )z5This module contains objects that represent stickers.    )TYPE_CHECKINGFinalOptionalSequenceTuple)	constants)_BaseThumbedMedium)File)	PhotoSize)TelegramObject)enum)parse_sequence_arg)JSONDict)Botc                       s   e Zd ZU dZdZdddeeeeeeeee ee ee ed ed ee ee	 ee ee
 d fdd	ZejjZee ed
< ejjZee ed< ejjZee ed< edee
 ed ed  d fddZ  ZS )Stickeraj  This object represents a sticker.

    Objects of this class are comparable in terms of equality. Two objects of this class are
    considered equal, if their :attr:`file_unique_id` is equal.

    Note:
        As of v13.11 :paramref:`is_video` is a required argument and therefore the order of the
        arguments had to be changed. Use keyword arguments to make sure that the arguments are
        passed correctly.

    .. versionchanged:: 20.5
      |removed_thumb_note|

    Args:
        file_id (:obj:`str`): Identifier for this file, which can be used to download
            or reuse the file.
        file_unique_id (:obj:`str`): Unique identifier for this file, which
            is supposed to be the same over time and for different bots.
            Can't be used to download or reuse the file.
        width (:obj:`int`): Sticker width.
        height (:obj:`int`): Sticker height.
        is_animated (:obj:`bool`): :obj:`True`, if the sticker is animated.
        is_video (:obj:`bool`): :obj:`True`, if the sticker is a video sticker.

            .. versionadded:: 13.11
        type (:obj:`str`): Type of the sticker. Currently one of :attr:`REGULAR`,
            :attr:`MASK`, :attr:`CUSTOM_EMOJI`. The type of the sticker is independent from its
            format, which is determined by the fields :attr:`is_animated` and :attr:`is_video`.

            .. versionadded:: 20.0
        emoji (:obj:`str`, optional): Emoji associated with the sticker
        set_name (:obj:`str`, optional): Name of the sticker set to which the sticker belongs.
        mask_position (:class:`telegram.MaskPosition`, optional): For mask stickers, the position
            where the mask should be placed.
        file_size (:obj:`int`, optional): File size in bytes.

        premium_animation (:class:`telegram.File`, optional): For premium regular stickers,
            premium animation for the sticker.

            .. versionadded:: 20.0
        custom_emoji_id (:obj:`str`, optional): For custom emoji stickers, unique identifier of the
            custom emoji.

            .. versionadded:: 20.0
        thumbnail (:class:`telegram.PhotoSize`, optional): Sticker thumbnail in the ``.WEBP`` or
            ``.JPG`` format.

            .. versionadded:: 20.2
        needs_repainting (:obj:`bool`, optional): :obj:`True`, if the sticker must be repainted to
            a text color in messages, the color of the Telegram Premium badge in emoji status,
            white color on chat photos, or another appropriate color in other places.

            .. versionadded:: 20.2

    Attributes:
        file_id (:obj:`str`): Identifier for this file, which can be used to download
            or reuse the file.
        file_unique_id (:obj:`str`): Unique identifier for this file, which
            is supposed to be the same over time and for different bots.
            Can't be used to download or reuse the file.
        width (:obj:`int`): Sticker width.
        height (:obj:`int`): Sticker height.
        is_animated (:obj:`bool`): :obj:`True`, if the sticker is animated.
        is_video (:obj:`bool`): :obj:`True`, if the sticker is a video sticker.

            .. versionadded:: 13.11
        type (:obj:`str`): Type of the sticker. Currently one of :attr:`REGULAR`,
            :attr:`MASK`, :attr:`CUSTOM_EMOJI`. The type of the sticker is independent from its
            format, which is determined by the fields :attr:`is_animated` and :attr:`is_video`.

            .. versionadded:: 20.0
        emoji (:obj:`str`): Optional. Emoji associated with the sticker.
        set_name (:obj:`str`): Optional. Name of the sticker set to which the sticker belongs.
        mask_position (:class:`telegram.MaskPosition`): Optional. For mask stickers, the position
            where the mask should be placed.
        file_size (:obj:`int`): Optional. File size in bytes.

        premium_animation (:class:`telegram.File`): Optional. For premium regular stickers,
            premium animation for the sticker.

            .. versionadded:: 20.0
        custom_emoji_id (:obj:`str`): Optional. For custom emoji stickers, unique identifier of the
            custom emoji.

            .. versionadded:: 20.0
        thumbnail (:class:`telegram.PhotoSize`): Optional. Sticker thumbnail in the ``.WEBP`` or
            ``.JPG`` format.

            .. versionadded:: 20.2
        needs_repainting (:obj:`bool`): Optional. :obj:`True`, if the sticker must be repainted to
            a text color in messages, the color of the Telegram Premium badge in emoji status,
            white color on chat photos, or another appropriate color in other places.

            .. versionadded:: 20.2
    )custom_emoji_idemojiheightis_animatedis_videomask_positionneeds_repaintingpremium_animationset_nametypewidthN
api_kwargsMaskPositionr	   )file_idfile_unique_idr   r   r   r   r   r   	file_sizer   r   r   r   	thumbnailr   r   c             	      s|   t  j|||	||d |  T || _|| _|| _|| _tt	j
||| _|| _|
| _|| _|| _|| _|| _W 5 Q R X d S )N)r   r    r!   r"   r   )super__init__Z	_unfrozenr   r   r   r   r   Z
get_memberr   StickerTyper   r   r   r   r   r   r   )selfr   r    r   r   r   r   r   r   r!   r   r   r   r   r"   r   r   	__class__ ;/tmp/pip-unpacked-wheel-swnnwir2/telegram/_files/sticker.pyr$      s&    
zSticker.__init__REGULARMASKCUSTOM_EMOJIr   databotreturnc                    s   |  |}|sdS t|d||d< t|d||d< t|d||d< i }|ddk	rt|d|d< t j|||dS ),See :meth:`telegram.TelegramObject.de_json`.Nr"   r   r   thumbr/   r0   r   )	Z_parse_datar
   de_jsongetr   r	   popr#   _de_json)clsr/   r0   r   r'   r)   r*   r5      s    
zSticker.de_json)NNNNNNNN)N)__name__
__module____qualname____doc__	__slots__strintboolr   r
   r   r$   r   r%   r+   r   __annotations__r,   r-   classmethodr5   __classcell__r)   r)   r'   r*   r   #   sF   
`        *r   c                	       sp   e Zd ZdZdZdddeeee eee	 ee
 d fddZedee
 ed ed  d	 fd
dZ  ZS )
StickerSeta  This object represents a sticker set.

    Objects of this class are comparable in terms of equality. Two objects of this class are
    considered equal, if their :attr:`name` is equal.

    Note:
        As of v13.11 :paramref:`is_video` is a required argument and therefore the order of the
        arguments had to be changed. Use keyword arguments to make sure that the arguments are
        passed correctly.

    .. versionchanged:: 20.0
        The parameter ``contains_masks`` has been removed. Use :paramref:`sticker_type` instead.


    .. versionchanged:: 21.1
        The parameters ``is_video`` and ``is_animated`` are deprecated and now made optional. Thus,
        the order of the arguments had to be changed.

    .. versionchanged:: 20.5
       |removed_thumb_note|

    .. versionremoved:: 21.2
       Removed the deprecated arguments and attributes ``is_animated`` and ``is_video``.

    Args:
        name (:obj:`str`): Sticker set name.
        title (:obj:`str`): Sticker set title.
        stickers (Sequence[:class:`telegram.Sticker`]): List of all set stickers.

            .. versionchanged:: 20.0
                |sequenceclassargs|

        sticker_type (:obj:`str`): Type of stickers in the set, currently one of
            :attr:`telegram.Sticker.REGULAR`, :attr:`telegram.Sticker.MASK`,
            :attr:`telegram.Sticker.CUSTOM_EMOJI`.

            .. versionadded:: 20.0
        thumbnail (:class:`telegram.PhotoSize`, optional): Sticker set thumbnail in the ``.WEBP``,
            ``.TGS``, or ``.WEBM`` format.

            .. versionadded:: 20.2

    Attributes:
        name (:obj:`str`): Sticker set name.
        title (:obj:`str`): Sticker set title.
        stickers (Tuple[:class:`telegram.Sticker`]): List of all set stickers.

            .. versionchanged:: 20.0
                |tupleclassattrs|

        sticker_type (:obj:`str`): Type of stickers in the set, currently one of
            :attr:`telegram.Sticker.REGULAR`, :attr:`telegram.Sticker.MASK`,
            :attr:`telegram.Sticker.CUSTOM_EMOJI`.

            .. versionadded:: 20.0
        thumbnail (:class:`telegram.PhotoSize`): Optional. Sticker set thumbnail in the ``.WEBP``,
            ``.TGS``, or ``.WEBM`` format.

            .. versionadded:: 20.2
    )namesticker_typestickersr"   titleNr   )rF   rI   rH   rG   r"   r   c                   sF   t  j|d || _|| _t|| _|| _|| _| jf| _| 	  d S Nr   )
r#   r$   rF   rI   r   rH   rG   r"   	_id_attrs_freeze)r&   rF   rI   rH   rG   r"   r   r'   r)   r*   r$     s    


zStickerSet.__init__r   r.   c                    sj   |sdS t |d||d< t|d||d< i }dD ]}||kr<||||< q<t j|||dS )r2   Nr"   rH   )Zcontains_masksr3   r   r   r4   )r
   r5   r6   r   Zde_listr7   r#   r8   )r9   r/   r0   r   Zdeprecated_fieldr'   r)   r*   r5   3  s    zStickerSet.de_json)N)N)r:   r;   r<   r=   r>   r?   r   r   r   r
   r   r$   rC   r5   rD   r)   r)   r'   r*   rE      s(   =   rE   c                       s   e Zd ZU dZdZejjZee	 e
d< ejjZee	 e
d< ejjZee	 e
d< ejjZee	 e
d< dde	eeeee d	 fd
dZ  ZS )r   a  This object describes the position on faces where a mask should be placed by default.

    Objects of this class are comparable in terms of equality. Two objects of this class are
    considered equal, if their :attr:`point`, :attr:`x_shift`, :attr:`y_shift` and, :attr:`scale`
    are equal.

    Args:
        point (:obj:`str`): The part of the face relative to which the mask should be placed.
            One of :attr:`FOREHEAD`, :attr:`EYES`, :attr:`MOUTH`, or :attr:`CHIN`.
        x_shift (:obj:`float`): Shift by X-axis measured in widths of the mask scaled to the face
            size, from left to right. For example, choosing ``-1.0`` will place mask just to the
            left of the default mask position.
        y_shift (:obj:`float`): Shift by Y-axis measured in heights of the mask scaled to the face
            size, from top to bottom. For example, ``1.0`` will place the mask just below the
            default mask position.
        scale (:obj:`float`): Mask scaling coefficient. For example, ``2.0`` means double size.

    Attributes:
        point (:obj:`str`): The part of the face relative to which the mask should be placed.
            One of :attr:`FOREHEAD`, :attr:`EYES`, :attr:`MOUTH`, or :attr:`CHIN`.
        x_shift (:obj:`float`): Shift by X-axis measured in widths of the mask scaled to the face
            size, from left to right. For example, choosing ``-1.0`` will place mask just to the
            left of the default mask position.
        y_shift (:obj:`float`): Shift by Y-axis measured in heights of the mask scaled to the face
            size, from top to bottom. For example, ``1.0`` will place the mask just below the
            default mask position.
        scale (:obj:`float`): Mask scaling coefficient. For example, ``2.0`` means double size.

    )pointscalex_shifty_shiftFOREHEADEYESMOUTHCHINNr   )rM   rO   rP   rN   r   c                   sH   t  j|d || _|| _|| _|| _| j| j| j| jf| _|   d S rJ   )r#   r$   rM   rO   rP   rN   rK   rL   )r&   rM   rO   rP   rN   r   r'   r)   r*   r$   r  s    	zMaskPosition.__init__)r:   r;   r<   r=   r>   r   r   rQ   r   r?   rB   rR   rS   rT   floatr   r   r$   rD   r)   r)   r'   r*   r   H  s   

r   N)r=   typingr   r   r   r   r   Ztelegramr   Z"telegram._files._basethumbedmediumr   Ztelegram._files.filer	   Ztelegram._files.photosizer
   Ztelegram._telegramobjectr   Ztelegram._utilsr   Ztelegram._utils.argumentparsingr   Ztelegram._utils.typesr   r   r   rE   r   r)   r)   r)   r*   <module>   s    6p