U
    2Òtc|  ã                   @   sd   d Z ddlmZmZmZmZmZ ddlmZm	Z	m
Z
 ddlmZ erPddlmZ G dd„ deƒZdS )	zHThis module contains an object that represents a Telegram MessageEntity.é    )ÚTYPE_CHECKINGÚAnyÚListÚOptionalÚClassVar)ÚTelegramObjectÚUserÚ	constants)ÚJSONDict)ÚBotc                
   @   sš  e Zd ZU dZdZdeeeeeeeedœdd„Z	e
ee ded  dœd	d
„ƒZejZee ed< ejZee ed< ejZee ed< ejZee ed< ejZee ed< ejZee ed< ejZee ed< ejZ ee ed< ej!Z"ee ed< ej#Z$ee ed< ej%Z&ee ed< ej'Z(ee ed< ej)Z*ee ed< ej+Z,ee ed< ej-Z.ee ed< ej/Z0ee ed< ej1Z2ee ed< ej3Z4ee5e  ed< d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. Currently, can be mention (@username), hashtag,
            bot_command, url, email, phone_number, bold (bold text), italic (italic text),
            strikethrough, spoiler (spoiler message), code (monowidth string), pre
            (monowidth block), text_link (for clickable text URLs), text_mention
            (for users without usernames), custom_emoji (for inline custom emoji stickers).

            .. versionadded:: 13.14
                added inline custom emoji
        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:: 13.14

    Attributes:
        type (:obj:`str`): Type of the entity.
        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. Url that will be opened after user taps on the text.
        user (:class:`telegram.User`): Optional. The mentioned user.
        language (:obj:`str`): Optional. Programming language of the entity text.
        custom_emoji_id (:obj:`str`): Optional. Unique identifier of the custom emoji.

            .. versionadded:: 13.14

    )ÚlengthÚurlÚuserÚtypeÚlanguageÚoffsetÚcustom_emoji_idÚ	_id_attrsN)r   r   r   r   r   r   r   Ú_kwargsc           	      K   s@   || _ || _|| _|| _|| _|| _|| _| j | j| jf| _d S )N)r   r   r   r   r   r   r   r   )	Úselfr   r   r   r   r   r   r   r   © r   ú:/tmp/pip-unpacked-wheel-2u9rcp5s/telegram/messageentity.pyÚ__init__U   s    zMessageEntity.__init__r   )ÚdataÚbotÚreturnc                 C   s2   |   |¡}|sdS t | d¡|¡|d< | f |ŽS )z,See :meth:`telegram.TelegramObject.de_json`.Nr   )Z_parse_datar   Úde_jsonÚget)Úclsr   r   r   r   r   r   l   s
    
zMessageEntity.de_jsonÚMENTIONÚHASHTAGÚCASHTAGÚPHONE_NUMBERÚBOT_COMMANDÚURLÚEMAILÚBOLDÚITALICÚCODEÚPREÚ	TEXT_LINKÚTEXT_MENTIONÚ	UNDERLINEÚSTRIKETHROUGHÚSPOILERÚCUSTOM_EMOJIÚ	ALL_TYPES)NNNN)6Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú	__slots__ÚstrÚintr   r   r   Úclassmethodr   r
   r   r	   ZMESSAGEENTITY_MENTIONr    r   Ú__annotations__ZMESSAGEENTITY_HASHTAGr!   ZMESSAGEENTITY_CASHTAGr"   ZMESSAGEENTITY_PHONE_NUMBERr#   ZMESSAGEENTITY_BOT_COMMANDr$   ZMESSAGEENTITY_URLr%   ZMESSAGEENTITY_EMAILr&   ZMESSAGEENTITY_BOLDr'   ZMESSAGEENTITY_ITALICr(   ZMESSAGEENTITY_CODEr)   ZMESSAGEENTITY_PREr*   ZMESSAGEENTITY_TEXT_LINKr+   ZMESSAGEENTITY_TEXT_MENTIONr,   ZMESSAGEENTITY_UNDERLINEr-   ZMESSAGEENTITY_STRIKETHROUGHr.   ZMESSAGEENTITY_SPOILERr/   ZMESSAGEENTITY_CUSTOM_EMOJIr0   ZMESSAGEENTITY_ALL_TYPESr1   r   r   r   r   r   r      sJ   
+    ø÷r   N)r5   Útypingr   r   r   r   r   Ztelegramr   r   r	   Ztelegram.utils.typesr
   r   r   r   r   r   r   Ú<module>   s   