+
    ?Qàjñ  ã                   ó²   € R t Rt^ RIt^ RIHt ^ RIHt ^ RIHt ^ RI	H
t
Ht ]'       d	   ^ RIHtHt RR R lltR	 R
 ltRR R lltR R ltRR R lltR# )zÎThis module contains convenience helper functions.

.. versionchanged:: 20.0
   Previously, the contents of this module were available through the (no longer existing)
   module ``telegram.utils.helpers``.
N©Úescape)ÚTYPE_CHECKING)ÚMarkdownVersion)ÚMessageLimitÚMessageType©ÚMessageÚUpdatec                óV   € V ^8„  d   QhR\         R\        R\         R,          R\         /# )é   ÚtextÚversionÚentity_typeNÚreturn)Ústrr   )Úformats   "Ú’/home/ubuntu/.hermes/installs/5f0a1ff4045d044e/environments/50f6b671e3f94b538e344231dfcb664f/venv/lib/python3.14/site-packages/telegram/helpers.pyÚ__annotate__r   -   s6   € ÷  Cñ  CÜ
ð CÜ'ð CÜ:=À½*ð Cäñ Có    c                óì   € \        V4      ^8X  d   RpM2\        V4      ^8X  d   VR	9   d   RpMVR
9   d   RpMRpM\        R4      h\        P                  ! R\        P                  ! V4       R2RV 4      # )az  Helper function to escape telegram markup symbols.

.. versionchanged:: 20.3
    Custom emoji entity escaping is now supported.

Args:
    text (:obj:`str`): The text.
    version (:obj:`int` | :obj:`str`): Use to specify the version of telegrams Markdown.
        Either ``1`` or ``2``. Defaults to ``1``.
    entity_type (:obj:`str`, optional): For the entity types
        :tg-const:`telegram.MessageEntity.PRE`, :tg-const:`telegram.MessageEntity.CODE` and
        the link part of :tg-const:`telegram.MessageEntity.TEXT_LINK` and
        :tg-const:`telegram.MessageEntity.CUSTOM_EMOJI`, only certain characters need to be
        escaped in :tg-const:`telegram.constants.ParseMode.MARKDOWN_V2`. See the `official API
        documentation <https://core.telegram.org/bots/api#formatting-options>`_ for details.
        Only valid in combination with ``version=2``, will be ignored else.
z_*`[z\`z\)z\_*[]()~`>#+-=|{}.!z'Markdown version must be either 1 or 2!z([z])z\\\1)ÚpreÚcode)Ú	text_linkÚcustom_emoji)ÚintÚ
ValueErrorÚreÚsubr   )r   r   r   Úescape_charss   &&& r   Úescape_markdownr    -   ss   € ô( ˆ7ƒ|�qÔØ‰Ü	ˆW‹˜Ô	Ø˜/Ô)Ø ‰LØÐ9Ô9Ø ‰Là1‰LäÐBÓCÐCä�6Š6�B”r—y’y Ó.Ð/¨rÐ2°G¸TÓBÐBr   c                óR   € V ^8„  d   QhR\         \        ,          R\        R\        /# )r   Úuser_idÚnamer   )r   r   )r   s   "r   r   r   P   s*   € ÷ Bñ Bœ#¤�)ð B¬3ð B´3ñ Br   c                ó&   € RV  R\        V4       R2# )zü
Helper function to create a user mention as HTML tag.

Args:
    user_id (:obj:`int`): The user's id which you want to mention.
    name (:obj:`str`): The name the mention is showing.

Returns:
    :obj:`str`: The inline mention for the user as HTML.
z<a href="tg://user?id=z">z</a>r   )r"   r#   s   &&r   Úmention_htmlr%   P   s   € ð $ G 9¨B¬v°d«|¨n¸DÐAÐAr   c                ó^   € V ^8„  d   QhR\         \        ,          R\        R\        R\        /# )r   r"   r#   r   r   )r   r   r   )r   s   "r   r   r   ^   s3   € ÷ Dñ Dœc¤C�ið D¬sð D¼_ð DÔUXñ Dr   c                óR   € RV  2pV^8X  d
   RV RV R2# R\        WR7       RV R2# )a“  
Helper function to create a user mention in Markdown syntax.

Args:
    user_id (:obj:`int`): The user's id which you want to mention.
    name (:obj:`str`): The name the mention is showing.
    version (:obj:`int` | :obj:`str`): Use to specify the version of Telegram's Markdown.
        Either ``1`` or ``2``. Defaults to ``1``.

Returns:
    :obj:`str`: The inline mention for the user as Markdown.
ztg://user?id=Ú[z](Ú))r   )r    )r"   r#   r   Útg_links   &&& r   Úmention_markdownr+   ^   sG   € ð ˜g˜YÐ'€GØ�!„|Ø�4�&˜˜7˜) 1Ð%Ð%ØŒ˜tÔ5Ð6°b¸¸	ÀÐCÐCr   c                ó6   € V ^8„  d   QhRRR\         R,          /# )r   ÚentityzMessage | Updater   N)r   )r   s   "r   r   r   q   s   € ÷ !ñ !Ð#5ð !¼#À½*ñ !r   c                ó  € ^ RI HpHp \        W4      '       d   T pMJ\        W4      '       d"   V P                  '       g   R# V P                  pM\        R\        V 4       R24      h\         F  pW4,          '       g   K  Vu # 	  R# )a«  
Extracts the type of message as a string identifier from a :class:`telegram.Message` or a
:class:`telegram.Update`.

Args:
    entity (:class:`telegram.Update` | :class:`telegram.Message`): The ``update`` or
        ``message`` to extract from.

Returns:
    :obj:`str` | :obj:`None`: One of :class:`telegram.constants.MessageType` if the entity
    contains a message that matches one of those types. :obj:`None` otherwise.

r   Nz/The entity is neither Message nor Update (got: r)   )Útelegramr	   r
   Ú
isinstanceÚeffective_messageÚ	TypeErrorÚtyper   )r-   r	   r
   ÚmessageÚmessage_types   &    r   Úeffective_message_typer6   q   sv   € ÷ô
 �&×"Ò"Ø‰Ü	�F×	#Ò	#Ø×'×'Ð'ÙØ×*Ñ*‰äÐIÌ$ÈvË,ÈÐWXÐYÓZÐZç#ˆØ× Ö ØÒñ $ñ r   c                óV   € V ^8„  d   QhR\         R\         R,          R\        R\         /# )r   Úbot_usernameÚpayloadNÚgroupr   )r   Úbool)r   s   "r   r   r   •   s0   € ÷ 7)ñ 7)Üð7)Ü # d¥
ð7)Ü:>ð7)äñ7)r   c                óP  € V e   \        V 4      ^8:  d   \        R4      hRV  2pV'       g   V# \        V4      \        P                  8”  d   \        R\        P                   R24      h\        P
                  ! RV4      '       g   \        R4      hV'       d   RMRpV R	V R
V 2# )a  
Creates a deep-linked URL for this :paramref:`~create_deep_linked_url.bot_username` with the
specified :paramref:`~create_deep_linked_url.payload`. See
https://core.telegram.org/bots/features#deep-linking to learn more.

The :paramref:`~create_deep_linked_url.payload` may consist of the following characters:
``A-Z, a-z, 0-9, _, -``

Note:
    Works well in conjunction with
    ``CommandHandler("start", callback, filters=filters.Regex('payload'))``

Examples:
    * ``create_deep_linked_url(bot.get_me().username, "some-params")``
    * :any:`Deep Linking <examples.deeplinking>`

Args:
    bot_username (:obj:`str`): The username to link to.
    payload (:obj:`str`, optional): Parameters to encode in the created URL.
    group (:obj:`bool`, optional): If :obj:`True` the user is prompted to select a group to
        add the bot to. If :obj:`False`, opens a one-on-one conversation with the bot.
        Defaults to :obj:`False`.

Returns:
    :obj:`str`: An URL to start the bot with specific parameters.

Raises:
    :exc:`ValueError`: If the length of the :paramref:`payload` exceeds         :tg-const:`telegram.constants.MessageLimit.DEEP_LINK_LENGTH` characters,
        contains invalid characters, or if the :paramref:`bot_username` is less than 4
        characters.
z&You must provide a valid bot_username.zhttps://t.me/z)The deep-linking payload must not exceed z characters.z^[A-Za-z0-9_-]+$zVOnly the following characters are allowed for deep-linked URLs: A-Z, a-z, 0-9, _ and -Ú
startgroupÚstartÚ?Ú=)Úlenr   r   ÚDEEP_LINK_LENGTHr   Úmatch)r8   r9   r:   Úbase_urlÚkeys   &&&  r   Úcreate_deep_linked_urlrF   •   s²   € ðF Òœs <Ó0°AÔ5ÜÐAÓBÐBà˜|˜nÐ-€HßØˆä
ˆ7ƒ|”l×3Ñ3Ô3ÜØ7¼×8UÑ8UÐ7VÐVbÐcó
ð 	
ô �8Š8Ð'¨×1Ò1Üð+ó
ð 	
÷
  ‰, W€CàˆZ�q˜˜˜Q˜w˜iÐ(Ð(r   )rF   r6   r    r%   r+   )é   N)rG   )NF)Ú__doc__Ú__all__r   Úhtmlr   Útypingr   Útelegram._utils.typesr   Útelegram.constantsr   r   r/   r	   r
   r    r%   r+   r6   rF   © r   r   Ú<module>rO      sK   ðñ&ð€ó 
Ý Ý  å 1ß 8çß(÷ CõFB÷Dõ&!÷H7)ñ 7)r   