L i>dZddlmZddlmZmZmZddlmZddl m Z ddl m Z ddl mZddlmZdd lmZdd lmZmZmZdd lmZerdd lmZGd de ZGddeZGddeZy)z5This module contains objects that represent stickers.)Sequence) TYPE_CHECKINGFinalOptional) constants)_BaseThumbedMedium)File) PhotoSize)TelegramObject)enum)de_json_optionalde_list_optionalparse_sequence_arg)JSONDict)Botc#eZdZUdZdZ d dddedededed ed ed ed eed eedeededdeddeedee deedee f fdZ e jjZeeed< e jj"Zeeed< e jj$Zeeed< ed!de dedddffd ZxZS)"StickerajThis 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_idemojiheight is_animatedis_video mask_positionneeds_repaintingpremium_animationset_nametypewidthN api_kwargsfile_idfile_unique_idrrrrrr file_sizerr MaskPositionrr r thumbnailrr cXt|||| |||j5||_||_||_||_tjtj|||_ ||_ | |_ | |_| |_| |_||_dddy#1swYyxYw)N)r!r"r#r%r )super__init__ _unfrozenrrrrr get_memberr StickerTyperrrrrrr)selfr!r"rrrrrrr#rrrrr%rr __class__s ]/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/telegram/_files/sticker.pyr(zSticker.__init__s( )!  ^^  E#DJ%DK%0D "*DM!__Y-B-BD$ODI(-DJ+3DM9FD 5FD "2AD 4DD ! E E Es A1B  B)REGULARMASK CUSTOM_EMOJIdatabotrreturncj|j|}t|jdt||d<t|jdt||d<t|jdt ||d<i}|jd|j d|d<t|!|||S),See :meth:`telegram.TelegramObject.de_json`.r%rrthumbr2r3r ) _parse_datar getr r$r popr'_de_json)clsr2r3r r-s r.de_jsonzSticker.de_jsonst$,TXXk-BIsS[ 0/1JLZ] ^_$4TXX>Q5RTXZ]$^ !  88G  ("&((7"3Jw wTszJJ)NNNNNNNNN)__name__ __module__ __qualname____doc__ __slots__strintboolrr rr(rr+r/r__annotations__r0r1 classmethodr> __classcell__r-s@r.rr%s^@ I. $#'"&26.2)-)-+/!(E$*.%(E(E(E (E  (E  (E(E(E}(EC=(E3-(E /(E$F+(E"#(EI&(E #4.!(E$X&%(ET$//77GU3Z79 ,,11D%*16(44AAL%*A>K8K(5/KYKKr?rceZdZdZdZ ddddededeeded ee d ee f fd Z e dd e d edddffd Z xZS) StickerSetaThis 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_typestickersr%titleNrrOrRrQrPr%r ct||||_||_t ||_||_||_|jf|_|jyNr) r'r(rOrRrrQrPr% _id_attrs_freeze)r,rOrRrQrPr%r r-s r.r(zStickerSet.__init__sT J/  -?-I !-.7)) r?r2r3rr4c|j|}t|jdt||d<t |jdt ||d<i}dD]}||vs|j |||<t|!|||S)r6r%rQ)contains_masksr7rrr8) r9r r:r rrr;r'r<)r=r2r3r deprecated_fieldr-s r.r>zStickerSet.de_json2st$,TXXk-BIsS[+DHHZ,@'3OZ !W J 4'/3xx8H/I +, JwTszJJr?r@)rArBrCrDrErFrrrr rr(rJr>rKrLs@r.rNrNs;zI*. *.7#    I& X&*K8K(5/K\KKr?rNc BeZdZUdZdZej jZee e d< ej jZ ee e d< ej jZ ee e d< ej jZ ee e d< ddd e d ed ed ed eef fdZxZS)r$aThis 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. )pointscalex_shifty_shiftFOREHEADEYESMOUTHCHINNrr[r]r^r\r ct||||_||_||_||_|j|j|j|j f|_|jyrT)r'r(r[r]r^r\rUrV)r,r[r]r^r\r r-s r.r(zMaskPosition.__init__nsZ J/ % % ! **dllDLL$**M r?)rArBrCrDrErr$r_rrFrIr`rarbfloatrrr(rKrLs@r.r$r$Ds<9I$11::HeCj:; --22D%*27!..44E5:48 --22D%*27*.   X&r?r$N)rDcollections.abcrtypingrrrtelegramr"telegram._files._basethumbedmediumrtelegram._files.filer telegram._files.photosizer telegram._telegramobjectr telegram._utilsr telegram._utils.argumentparsingr rrtelegram._utils.typesrrrrNr$r?r.rpsc&<$11A%/3 bb*oK oKdjKjKZ;>;r?