
    i#                         d Z ddl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 erddlmZ  G d	 d
e	          ZdS )zHThis module contains an object that represents a Telegram MessageEntity.    )TYPE_CHECKINGFinalListOptional)	constants)TelegramObject)User)enum)JSONDict)Botc                       e Zd ZU dZdZ	 	 	 	 d'dddedededee         d	ee         d
ee         dee         dee	         f fdZ
edee	         ddded          f fd            Z eej                  Ze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<   	 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<   	 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<   	 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"<   	 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&<    xZ'S )(MessageEntitya  
    This object represents one special entity in a text message. For example, hashtags,
    usernames, URLs, etc.

    Objects of this class are comparable in terms of equality. Two objects of this class are
    considered equal, if their :attr:`type`, :attr:`offset` and :attr:`length` are equal.

    Args:
        type (:obj:`str`): Type of the entity. Can be :attr:`MENTION` (@username),
            :attr:`HASHTAG` (#hashtag), :attr:`CASHTAG` ($USD), :attr:`BOT_COMMAND`
            (/start@jobs_bot), :attr:`URL` (https://telegram.org),
            :attr:`EMAIL` (do-not-reply@telegram.org), :attr:`PHONE_NUMBER` (+1-212-555-0123),
            :attr:`BOLD` (**bold text**), :attr:`ITALIC` (*italic text*), :attr:`UNDERLINE`
            (underlined text), :attr:`STRIKETHROUGH`, :attr:`SPOILER` (spoiler message),
            :attr:`BLOCKQUOTE` (block quotation), :attr:`CODE` (monowidth string), :attr:`PRE`
            (monowidth block), :attr:`TEXT_LINK` (for clickable text URLs), :attr:`TEXT_MENTION`
            (for users without usernames), :attr:`CUSTOM_EMOJI` (for inline custom emoji stickers).

            .. versionadded:: 20.0
                Added inline custom emoji

            .. versionadded:: 20.8
                Added block quotation
        offset (:obj:`int`): Offset in UTF-16 code units to the start of the entity.
        length (:obj:`int`): Length of the entity in UTF-16 code units.
        url (:obj:`str`, optional): For :attr:`TEXT_LINK` only, url that will be opened after
            user taps on the text.
        user (:class:`telegram.User`, optional): For :attr:`TEXT_MENTION` only, the mentioned
             user.
        language (:obj:`str`, optional): For :attr:`PRE` only, the programming language of
            the entity text.
        custom_emoji_id (:obj:`str`, optional): For :attr:`CUSTOM_EMOJI` only, unique identifier
            of the custom emoji. Use :meth:`telegram.Bot.get_custom_emoji_stickers` to get full
            information about the sticker.

            .. versionadded:: 20.0
    Attributes:
        type (:obj:`str`): Type of the entity. Can be :attr:`MENTION` (@username),
            :attr:`HASHTAG` (#hashtag), :attr:`CASHTAG` ($USD), :attr:`BOT_COMMAND`
            (/start@jobs_bot), :attr:`URL` (https://telegram.org),
            :attr:`EMAIL` (do-not-reply@telegram.org), :attr:`PHONE_NUMBER` (+1-212-555-0123),
            :attr:`BOLD` (**bold text**), :attr:`ITALIC` (*italic text*), :attr:`UNDERLINE`
            (underlined text), :attr:`STRIKETHROUGH`, :attr:`SPOILER` (spoiler message),
            :attr:`BLOCKQUOTE` (block quotation), :attr:`CODE` (monowidth string), :attr:`PRE`
            (monowidth block), :attr:`TEXT_LINK` (for clickable text URLs), :attr:`TEXT_MENTION`
            (for users without usernames), :attr:`CUSTOM_EMOJI` (for inline custom emoji stickers).

            .. versionadded:: 20.0
                Added inline custom emoji

            .. versionadded:: 20.8
                Added block quotation
        offset (:obj:`int`): Offset in UTF-16 code units to the start of the entity.
        length (:obj:`int`): Length of the entity in UTF-16 code units.
        url (:obj:`str`): Optional. For :attr:`TEXT_LINK` only, url that will be opened after
            user taps on the text.
        user (:class:`telegram.User`): Optional. For :attr:`TEXT_MENTION` only, the mentioned
             user.
        language (:obj:`str`): Optional. For :attr:`PRE` only, the programming language of
            the entity text.
        custom_emoji_id (:obj:`str`): Optional. For :attr:`CUSTOM_EMOJI` only, unique identifier
            of the custom emoji. Use :meth:`telegram.Bot.get_custom_emoji_stickers` to get full
            information about the sticker.

            .. versionadded:: 20.0

    )custom_emoji_idlanguagelengthoffsettypeurluserN
api_kwargsr   r   r   r   r   r   r   r   c                D   t                                          |           t          j        t          j        ||          | _        || _        || _        || _	        || _
        || _        || _        | j        | j        | j        f| _        |                                  d S )Nr   )super__init__r
   
get_memberr   MessageEntityTyper   r   r   r   r   r   r   	_id_attrs_freeze)
selfr   r   r   r   r   r   r   r   	__class__s
            ]/var/www/html/crypto-bot/backend/venv/lib/python3.11/site-packages/telegram/_messageentity.pyr   zMessageEntity.__init__h   s     	J///)DdDQQ	!!"%$(	'/.=)T[$+>    databotr   returnc                     |                      |          }|sdS t          j        |                    d          |          |d<   t	                                          ||          S )z,See :meth:`telegram.TelegramObject.de_json`.Nr   )r#   r$   )_parse_datar	   de_jsongetr   )clsr#   r$   r    s      r!   r(   zMessageEntity.de_json   s^     t$$ 	4|DHHV$4$4c::VwwDc222r"   	ALL_TYPES
BLOCKQUOTEBOLDBOT_COMMANDCASHTAGCODECUSTOM_EMOJIEMAILEXPANDABLE_BLOCKQUOTEHASHTAGITALICMENTIONPHONE_NUMBERPRESPOILERSTRIKETHROUGH	TEXT_LINKTEXT_MENTION	UNDERLINEURL)NNNN)(__name__
__module____qualname____doc__	__slots__strintr   r	   r   r   classmethodr(   listr   r   r+   r   r   __annotations__r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   r<   r=   r>   __classcell__)r    s   @r!   r   r   !   sz        B BH [I "#"&)- *.    	
 c] tn 3- "# X&     6 	38H- 	3E 	3h>W 	3 	3 	3 	3 	3 [	3 #'$y'B"C"CIuT#YCCCI&8CJc
CCC !27D%*777<'9EKsEEEC#5=GU3Z===? 27D%*777<(:GL%*GGG "39E5:999=(1(C(Y5:YYY $5=GU3Z===?"4;FE#J;;;>#5=GU3Z===?(:GL%*GGGD15Cs555;#5=GU3Z=== !* ; IM5:IIIE%7AIuSzAAAA(:GL%*GGGD%7AIuSzAAAA15Cs555;;;;r"   r   N)rB   typingr   r   r   r   telegramr   telegram._telegramobjectr   telegram._userr	   telegram._utilsr
   telegram._utils.typesr   r   r    r"   r!   <module>rQ      s   & O N 7 7 7 7 7 7 7 7 7 7 7 7       3 3 3 3 3 3                   * * * * * * a< a< a< a< a<N a< a< a< a< a<r"   