§
    êd×iF6  ã                   óˆ   — d Z ddl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 erddlmZ e G d„ d	¦  «        ¦   «         ZdS )
z\This module contains the class Defaults, which allows passing default values to Application.é    N)ÚTYPE_CHECKINGÚAnyÚNoReturnÚfinal)ÚUTC)Úwarn)ÚPTBDeprecationWarning)ÚLinkPreviewOptionsc                   óð  — e Zd ZdZdZddedddddfdedz  dedz  dej	        ded	edz  d
edz  dddedz  fd„Z
defd„Zdedefd„Zedeeef         fd„¦   «         Zededz  fd„¦   «         Zej        dedefd„¦   «         Zededz  fd„¦   «         Zej        dedefd„¦   «         Zededz  fd„¦   «         Zej        dedefd„¦   «         Zededz  fd„¦   «         Zej        dedefd„¦   «         Zededz  fd„¦   «         Zej        dedefd„¦   «         Zededz  fd„¦   «         Zej        dedefd „¦   «         Zededz  fd!„¦   «         Zej        dedefd"„¦   «         Zedej	        fd#„¦   «         Z	e	j        dedefd$„¦   «         Z	edefd%„¦   «         Zej        dedefd&„¦   «         Zededz  fd'„¦   «         Zej        dedefd(„¦   «         Zed+d)„¦   «         Zededz  fd*„¦   «         ZdS ),ÚDefaultsaø  Convenience Class to gather all parameters with a (user defined) default value

    .. seealso:: :wiki:`Architecture Overview <Architecture>`,
        :wiki:`Adding Defaults to Your Bot <Adding-defaults-to-your-bot>`

    .. versionchanged:: 20.0
        Removed the argument and attribute ``timeout``. Specify default timeout behavior for the
        networking backend directly via :class:`telegram.ext.ApplicationBuilder` instead.

    .. versionchanged:: 22.0
        Removed deprecated arguments and properties ``disable_web_page_preview`` and ``quote``.
        Use :paramref:`link_preview_options` and :paramref:`do_quote` instead.

    Parameters:
        parse_mode (:obj:`str`, optional): |parse_mode|
        disable_notification (:obj:`bool`, optional): |disable_notification|
        allow_sending_without_reply (:obj:`bool`, optional): |allow_sending_without_reply|.
            Will be used for :attr:`telegram.ReplyParameters.allow_sending_without_reply`.
        tzinfo (:class:`datetime.tzinfo`, optional): A timezone to be used for all date(time)
            inputs appearing throughout PTB, i.e. if a timezone naive date(time) object is passed
            somewhere, it will be assumed to be in :paramref:`tzinfo`. Defaults to
            :attr:`datetime.timezone.utc` otherwise.

            .. deprecated:: 21.10
                Support for ``pytz`` timezones is deprecated and will be removed in future
                versions.

        block (:obj:`bool`, optional): Default setting for the :paramref:`BaseHandler.block`
            parameter
            of handlers and error handlers registered through :meth:`Application.add_handler` and
            :meth:`Application.add_error_handler`. Defaults to :obj:`True`.
        protect_content (:obj:`bool`, optional): |protect_content|

            .. versionadded:: 20.0
        link_preview_options (:class:`telegram.LinkPreviewOptions`, optional):
            Link preview generation options for all outgoing messages. Mutually exclusive with
            :paramref:`disable_web_page_preview`.
            This object is used for the corresponding parameter of
            :meth:`telegram.Bot.send_message`, :meth:`telegram.Bot.edit_message_text`,
            and :class:`telegram.InputTextMessageContent` if not specified. If a value is specified
            for the corresponding parameter, only those parameters of
            :class:`telegram.LinkPreviewOptions` will be overridden that are not
            explicitly set.

            Example:

                .. code-block:: python

                    from telegram import LinkPreviewOptions
                    from telegram.ext import Defaults, ExtBot

                    defaults = Defaults(
                        link_preview_options=LinkPreviewOptions(show_above_text=True)
                    )
                    chat_id = 123

                    async def main():
                        async with ExtBot("Token", defaults=defaults) as bot:
                            # The link preview will be shown above the text.
                            await bot.send_message(chat_id, "https://python-telegram-bot.org")

                            # The link preview will be shown below the text.
                            await bot.send_message(
                                chat_id,
                                "https://python-telegram-bot.org",
                                link_preview_options=LinkPreviewOptions(show_above_text=False)
                            )

                            # The link preview will be shown above the text, but the preview will
                            # show Telegram.
                            await bot.send_message(
                                chat_id,
                                "https://python-telegram-bot.org",
                                link_preview_options=LinkPreviewOptions(url="https://telegram.org")
                            )

            .. versionadded:: 20.8
        do_quote(:obj:`bool`, optional): |reply_quote|

            .. versionadded:: 20.8
    )	Ú_allow_sending_without_replyÚ_api_defaultsÚ_blockÚ_disable_notificationÚ	_do_quoteÚ_link_preview_optionsÚ_parse_modeÚ_protect_contentÚ_tzinfoNTÚ
parse_modeÚdisable_notificationÚtzinfoÚblockÚallow_sending_without_replyÚprotect_contentÚlink_preview_optionsúLinkPreviewOptions | NoneÚdo_quotec	                 ó<  — || _         || _        || _        || _        || _        || _        dt          | j        j        ¦  «        v r t          t          dd¬¦  «        d¬¦  «         || _
        || _        i | _        dD ]}	t          | |	¦  «        }
|

|
| j        |	<   Œd S )NÚpytzz21.10zPSupport for pytz timezones is deprecated and will be removed in future versions.)ÚversionÚmessageé   )r"   Ú
stacklevel)	r   r   r   Úexplanation_parse_moder   r   Útext_parse_moder   Úquestion_parse_mode)r   r   r   r   r   r   ÚstrÚ	__class__r   r	   r   r   r   Úgetattr)Úselfr   r   r   r   r   r   r   r   ÚkwargÚvalues              úS/root/projects/qq-shell/venv/lib/python3.11/site-packages/telegram/ext/_defaults.pyÚ__init__zDefaults.__init__€   sÛ   € ð (2ˆÔØ2FˆÔ"Ø9TˆÔ)Ø#)ˆŒØ!ˆŒØ-<ˆÔà•S˜œÔ/Ñ0Ô0Ð0Ð0åÝ-Ø#ð+ðñ ô ð ð	ñ 	ô 	ð 	ð &:ˆÔ"Ø!ˆŒð  ˆÔð

ð 	2ð 	2ˆEõ ˜D %Ñ(Ô(ˆEØÐ Ø,1Ô" 5Ñ)øð	2ð 	2ó    Úreturnc           
      ó€   — t          | j        | j        | j        | j        | j        | j        | j        | j        f¦  «        S )zçBuilds a hash value for this object such that the hash of two objects is equal if and
        only if the objects are equal in terms of :meth:`__eq__`.

        Returns:
            :obj:`int` The hash value of the object.
        )	Úhashr   r   r   r   r   r   r   r   ©r+   s    r.   Ú__hash__zDefaults.__hash__³   sH   € õ àÔ ØÔ*ØÔ*ØÔ1Ø”Ø”Ø”ØÔ%ð	ñ
ô 
ð 	
r0   Úotherc                 óv   ‡ ‡— t          ‰t          ¦  «        r!t          ˆˆ fd„‰ j        D ¦   «         ¦  «        S dS )a"  Defines equality condition for the :class:`Defaults` object.
        Two objects of this class are considered to be equal if all their parameters
        are identical.

        Returns:
            :obj:`True` if both objects have all parameters identical. :obj:`False` otherwise.
        c              3   ó\   •K  — | ]&}t          ‰|¦  «        t          ‰|¦  «        k    V — Œ'd S ©N)r*   )Ú.0Úattrr6   r+   s     €€r.   ú	<genexpr>z"Defaults.__eq__.<locals>.<genexpr>Ð   s<   øè è € Ð^Ð^Àt•w˜t TÑ*Ô*­g°e¸TÑ.BÔ.BÒBÐ^Ð^Ð^Ð^Ð^Ð^r0   F)Ú
isinstancer   ÚallÚ	__slots__)r+   r6   s   ``r.   Ú__eq__zDefaults.__eq__Ç   sF   øø€ õ eXÑ&Ô&ð 	_ÝÐ^Ð^Ð^Ð^Ð^ÈtÌ~Ð^Ñ^Ô^Ñ^Ô^Ð^Øˆur0   c                 ó   — | j         S r9   )r   r4   s    r.   Úapi_defaultszDefaults.api_defaultsÓ   s   € àÔ!Ð!r0   c                 ó   — | j         S )z:obj:`str`: Optional. Send Markdown or HTML, if you want Telegram apps to show
        bold, italic, fixed-width text or URLs in your bot's message.
        ©r   r4   s    r.   r   zDefaults.parse_mode×   ó   € ð
 ÔÐr0   Ú_c                 ó    — t          d¦  «        ‚)NzBYou can not assign a new value to parse_mode after initialization.©ÚAttributeError©r+   rF   s     r.   r   zDefaults.parse_modeÞ   s   € åÐaÑbÔbÐbr0   c                 ó   — | j         S )zŒ:obj:`str`: Optional. Alias for :attr:`parse_mode`, used for
        the corresponding parameter of :meth:`telegram.Bot.send_poll`.
        rD   r4   s    r.   r%   zDefaults.explanation_parse_modeâ   rE   r0   c                 ó    — t          d¦  «        ‚)NzNYou can not assign a new value to explanation_parse_mode after initialization.rH   rJ   s     r.   r%   zDefaults.explanation_parse_modeé   s   € åØ\ñ
ô 
ð 	
r0   c                 ó   — | j         S )zŽ:obj:`str`: Optional. Alias for :attr:`parse_mode`, used for
        the corresponding parameter of :meth:`telegram.ReplyParameters`.
        rD   r4   s    r.   Úquote_parse_modezDefaults.quote_parse_modeï   rE   r0   c                 ó    — t          d¦  «        ‚)NzHYou can not assign a new value to quote_parse_mode after initialization.rH   rJ   s     r.   rN   zDefaults.quote_parse_modeö   s   € åØVñ
ô 
ð 	
r0   c                 ó   — | j         S )zÚ:obj:`str`: Optional. Alias for :attr:`parse_mode`, used for
        the corresponding parameter of :class:`telegram.InputPollOption` and
        :meth:`telegram.Bot.send_gift`.

        .. versionadded:: 21.2
        rD   r4   s    r.   r&   zDefaults.text_parse_modeü   s   € ð ÔÐr0   c                 ó    — t          d¦  «        ‚)NzGYou can not assign a new value to text_parse_mode after initialization.rH   rJ   s     r.   r&   zDefaults.text_parse_mode  s   € åØUñ
ô 
ð 	
r0   c                 ó   — | j         S )z¬:obj:`str`: Optional. Alias for :attr:`parse_mode`, used for
        the corresponding parameter of :meth:`telegram.Bot.send_poll`.

        .. versionadded:: 21.2
        rD   r4   s    r.   r'   zDefaults.question_parse_mode  s   € ð ÔÐr0   c                 ó    — t          d¦  «        ‚)NzKYou can not assign a new value to question_parse_mode after initialization.rH   rJ   s     r.   r'   zDefaults.question_parse_mode  s   € åØYñ
ô 
ð 	
r0   c                 ó   — | j         S )zt:obj:`bool`: Optional. Sends the message silently. Users will
        receive a notification with no sound.
        )r   r4   s    r.   r   zDefaults.disable_notification  s   € ð
 Ô)Ð)r0   c                 ó    — t          d¦  «        ‚)NzLYou can not assign a new value to disable_notification after initialization.rH   rJ   s     r.   r   zDefaults.disable_notification"  s   € åØZñ
ô 
ð 	
r0   c                 ó   — | j         S )zŽ:obj:`bool`: Optional. Pass :obj:`True`, if the message
        should be sent even if the specified replied-to message is not found.
        )r   r4   s    r.   r   z$Defaults.allow_sending_without_reply(  s   € ð
 Ô0Ð0r0   c                 ó    — t          d¦  «        ‚)NzSYou can not assign a new value to allow_sending_without_reply after initialization.rH   rJ   s     r.   r   z$Defaults.allow_sending_without_reply/  s   € åØañ
ô 
ð 	
r0   c                 ó   — | j         S )zj:obj:`tzinfo`: A timezone to be used for all date(time) objects appearing
        throughout PTB.
        )r   r4   s    r.   r   zDefaults.tzinfo5  s   € ð
 Œ|Ðr0   c                 ó    — t          d¦  «        ‚)Nz>You can not assign a new value to tzinfo after initialization.rH   rJ   s     r.   r   zDefaults.tzinfo<  s   € åÐ]Ñ^Ô^Ð^r0   c                 ó   — | j         S )zì:obj:`bool`: Optional. Default setting for the :paramref:`BaseHandler.block` parameter
        of handlers and error handlers registered through :meth:`Application.add_handler` and
        :meth:`Application.add_error_handler`.
        )r   r4   s    r.   r   zDefaults.block@  s   € ð Œ{Ðr0   c                 ó    — t          d¦  «        ‚)Nz=You can not assign a new value to block after initialization.rH   rJ   s     r.   r   zDefaults.blockH  s   € åÐ\Ñ]Ô]Ð]r0   c                 ó   — | j         S )z:obj:`bool`: Optional. Protects the contents of the sent message from forwarding and
        saving.

        .. versionadded:: 20.0
        )r   r4   s    r.   r   zDefaults.protect_contentL  s   € ð Ô$Ð$r0   c                 ó    — t          d¦  «        ‚)NzEYou can't assign a new value to protect_content after initialization.rH   rJ   s     r.   r   zDefaults.protect_contentU  s   € åØSñ
ô 
ð 	
r0   c                 ó   — | j         S )z›:class:`telegram.LinkPreviewOptions`: Optional. Link preview generation options for all
        outgoing messages.

        .. versionadded:: 20.8
        )r   r4   s    r.   r   zDefaults.link_preview_options[  s   € ð Ô)Ð)r0   c                 ó   — | j         S )zM:obj:`bool`: Optional. |reply_quote|

        .. versionadded:: 20.8
        )r   r4   s    r.   r   zDefaults.do_quoted  s   € ð Œ~Ðr0   )r1   r   ) Ú__name__Ú
__module__Ú__qualname__Ú__doc__r?   r   r(   ÚboolÚdtmr   r/   Úintr5   Úobjectr@   ÚpropertyÚdictr   rB   r   Úsetterr   r%   rN   r&   r'   r   r   r   r   r   r   © r0   r.   r   r       s!  € € € € € ðPð Pðd
€Ið "&Ø,0Ø ØØ37Ø'+Ø<@Ø $ð12ð 12à˜$‘Jð12ð # T™kð12ð ”
ð	12ð
 ð12ð &*¨D¡[ð12ð  ™ð12ð :ð12ð ˜‘+ð12ð 12ð 12ð 12ðf
˜#ð 
ð 
ð 
ð 
ð(
˜Fð 
 tð 
ð 
ð 
ð 
ð ð"˜d 3¨ 8œnð "ð "ð "ñ „Xð"ð ð ˜C $™Jð  ð  ð  ñ „Xð ð Ôðc˜Fð c xð cð cð cñ Ôðcð ð ¨¨d©
ð  ð  ð  ñ „Xð ð Ô"ð
¨ð 
°8ð 
ð 
ð 
ñ #Ô"ð
ð
 ð  #¨¡*ð  ð  ð  ñ „Xð ð Ôð
 &ð 
¨Xð 
ð 
ð 
ñ Ôð
ð
 ð   t¡ð  ð  ð  ñ „Xð ð Ôð
 ð 
¨Hð 
ð 
ð 
ñ Ôð
ð
 ð  S¨4¡Zð  ð  ð  ñ „Xð ð Ôð
 Vð 
°ð 
ð 
ð 
ñ  Ôð
ð
 ð* d¨T¡kð *ð *ð *ñ „Xð*ð Ô ð
 fð 
°ð 
ð 
ð 
ñ !Ô ð
ð
 ð1¨T°D©[ð 1ð 1ð 1ñ „Xð1ð !Ô'ð
¨Vð 
¸ð 
ð 
ð 
ñ (Ô'ð
ð
 ð˜œ
ð ð ð ñ „Xðð „]ð_˜ð _ 8ð _ð _ð _ñ „]ð_ð ðtð ð ð ñ „Xðð „\ð^vð ^ (ð ^ð ^ð ^ñ „\ð^ð ð% ¨¡ð %ð %ð %ñ „Xð%ð Ôð
 ð 
¨Hð 
ð 
ð 
ñ Ôð
ð
 ð*ð *ð *ñ „Xð*ð ð˜$ ™+ð ð ð ñ „Xðð ð r0   r   )rc   Údatetimere   Útypingr   r   r   r   Útelegram._utils.datetimer   Útelegram._utils.warningsr   Útelegram.warningsr	   Útelegramr
   r   rk   r0   r.   ú<module>rr      sÖ   ðð& cÐ bà Ð Ð Ð Ø 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6à (Ð (Ð (Ð (Ð (Ð (Ø )Ð )Ð )Ð )Ð )Ð )Ø 3Ð 3Ð 3Ð 3Ð 3Ð 3àð ,Ø+Ð+Ð+Ð+Ð+Ð+ð ðIð Ið Ið Ið Iñ Iô Iñ „ðIð Ið Ir0   