o
    ZzjÜ=  ã                   @   sÌ   d Z ddlmZ ddl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mZmZ ddlmZ erLd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.é    )ÚSequence)ÚTYPE_CHECKINGÚFinal)Ú	constants)Ú_BaseThumbedMedium)ÚFile)Ú	PhotoSize)ÚTelegramObject)Úenum)Úde_json_optionalÚde_list_optionalÚparse_sequence_arg)ÚJSONDict)ÚBotc                #       sþ   e Zd ZU dZdZ								d"ddœdedededed	ed
edededB dedB dedB dddddedB dedB dedB de	dB f ‡ 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#de	dddd f‡ 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Úfile_idÚfile_unique_idr   r   r   r   r   r   Ú	file_sizer   r   zMaskPosition | Noner   zFile | Noner   Ú	thumbnailr   r   c                   s’   t ƒ j|||	||d� |  ¡ �0 || _|| _|| _|| _t t	j
||¡| _|| _|
| _|| _|| _|| _|| _W d   ƒ d S 1 sBw   Y  d S )N)r   r   r    r!   r   )ÚsuperÚ__init__Ú	_unfrozenr   r   r   r   r
   Ú
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__© úR/var/www/kodo/tsheker/venv/lib/python3.10/site-packages/telegram/_files/sticker.pyr#   ”   s(   û
"ózSticker.__init__ÚREGULARÚMASKÚCUSTOM_EMOJIÚdataÚbotú
Bot | NoneÚreturnc                    s~   |   |¡}t| d¡t|ƒ|d< t| d¡t|ƒ|d< t| d¡t|ƒ|d< i }| d¡dur6| d¡|d< tƒ j|||d�S )ú,See :meth:`telegram.TelegramObject.de_json`.r!   r   r   ÚthumbN©r/   r0   r   )	Ú_parse_datar   Úgetr   ÚMaskPositionr   Úpopr"   Ú_de_json)Úclsr/   r0   r   r(   r*   r+   Úde_jsonÅ   s   
zSticker.de_json)NNNNNNNN©N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú	__slots__ÚstrÚintÚboolr   r   r#   r   r&   r,   r   Ú__annotations__r-   r.   Úclassmethodr<   Ú__classcell__r*   r*   r(   r+   r   %   sl   
 `ðîþýüûúùø	÷
öõôóòñðî*&r   c                       st   e Zd ZdZdZ	dddœdededee ded	edB d
e	dB f‡ fdd„Z
edde	dddd f‡ 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   rJ   rM   rL   rK   r!   r   c                   sF   t ƒ j|d� || _|| _t|ƒ| _|| _|| _| jf| _|  	¡  d S ©Nr   )
r"   r#   rJ   rM   r   rL   rK   r!   Ú	_id_attrsÚ_freeze)r'   rJ   rM   rL   rK   r!   r   r(   r*   r+   r#     s   


zStickerSet.__init__r/   r0   r1   r2   c                    sl   |   |¡}t| d¡t|ƒ|d< t| d¡t|ƒ|d< i }dD ]}||v r,| |¡||< qtƒ j|||d�S )r3   r!   rL   )Úcontains_masksr4   r   r   r5   )	r6   r   r7   r   r   r   r9   r"   r:   )r;   r/   r0   r   Údeprecated_fieldr(   r*   r+   r<   2  s   
€zStickerSet.de_jsonr=   )r>   r?   r@   rA   rB   rC   r   r   r   r   r#   rG   r<   rH   r*   r*   r(   r+   rI   ×   s*    =úøþýüûúø&rI   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œd	e	d
ededededB f
‡ fdd„Z‡  ZS )r8   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   rS   rU   rV   rT   r   c                   sH   t ƒ j|d� || _|| _|| _|| _| j| j| j| jf| _|  ¡  d S rN   )r"   r#   rS   rU   rV   rT   rO   rP   )r'   rS   rU   rV   rT   r   r(   r*   r+   r#   n  s   	zMaskPosition.__init__)r>   r?   r@   rA   rB   r   r8   rW   r   rC   rF   rX   rY   rZ   Úfloatr   r#   rH   r*   r*   r(   r+   r8   D  s.   
 	ùþýüûùr8   N)rA   Úcollections.abcr   Útypingr   r   Útelegramr   Ú"telegram._files._basethumbedmediumr   Útelegram._files.filer   Útelegram._files.photosizer   Útelegram._telegramobjectr	   Útelegram._utilsr
   Útelegram._utils.argumentparsingr   r   r   Útelegram._utils.typesr   r   r   rI   r8   r*   r*   r*   r+   Ú<module>   s"    3m