
    Yi{?                         S r SSKrSSKJrJrJrJr  SSKJr  SSK	J
r
  SSKJr  SSKJr  SSKJr  \ " S	 S
5      5       rg)z\This module contains the class Defaults, which allows passing default values to Application.    N)AnyNoReturnOptionalfinal)LinkPreviewOptions)UTC)ODVInput)warn)PTBDeprecationWarningc                      \ rS rSrSrSrSSSS\SSSSS4
S\\   S\\	   S\\	   S	\\	   S
\
R                  S\	S\\	   S\\	   S\S   S\\	   4S jjrS\4S jrS\S\	4S jr\S\\\4   4S j5       r\S\\   4S j5       r\R,                  S\S\4S j5       r\S\\   4S j5       r\R,                  S\S\4S j5       r\S\\   4S j5       r\R,                  S\S\4S j5       r\S\\   4S j5       r\R,                  S\S\4S j5       r\S\\   4S  j5       r\R,                  S\S\4S! j5       r\S\\	   4S" j5       r\R,                  S\S\4S# j5       r\S\\	   4S$ j5       r\R,                  S\S\4S% j5       r\S\\	   4S& j5       r\R,                  S\S\4S' j5       r\S\\	   4S( j5       r \ R,                  S\S\4S) j5       r \S\
R                  4S* j5       r\R,                  S\S\4S+ j5       r\S\	4S, j5       r!\!R,                  S\S\4S- j5       r!\S\\	   4S. j5       r"\"R,                  S\S\4S/ j5       r"\S\S   4S0 j5       r#\S\\	   4S1 j5       r$Sr%g)2Defaults   a@  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.

Parameters:
    parse_mode (:obj:`str`, optional): |parse_mode|
    disable_notification (:obj:`bool`, optional): |disable_notification|
    disable_web_page_preview (:obj:`bool`, optional): Disables link previews for links in this
        message. Mutually exclusive with :paramref:`link_preview_options`.

        .. deprecated:: 20.8
            Use :paramref:`link_preview_options` instead. This parameter will be removed in
            future versions.

    allow_sending_without_reply (:obj:`bool`, optional): |allow_sending_without_reply|.
        Will be used for :attr:`telegram.ReplyParameters.allow_sending_without_reply`.
    quote (:obj:`bool`, optional): |reply_quote|

        .. deprecated:: 20.8
            Use :paramref:`do_quote` instead. This parameter will be removed in future
            versions.
    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`. If the
        :class:`telegram.ext.JobQueue` is used, this must be a timezone provided
        by the ``pytz`` module. Defaults to ``pytz.utc``, if available, and
        :attr:`datetime.timezone.utc` otherwise.
    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disable_web_page_previewquotetzinfoblockallow_sending_without_replyprotect_contentlink_preview_optionsr   do_quotec                    Xl         X l        Xpl        XPl        X`l        Xl        Ub  U	b  [        S5      eUb  U
b  [        S5      eUb#  [        [        SS5      SS9  [        US9U l
        OXl
        Ub  [        [        SS5      SS9  X@l        OXl        0 U l        S	 H!  n[        X5      nUc  M  XR                  U'   M#     g )
NzM`disable_web_page_preview` and `link_preview_options` are mutually exclusive.z-`quote` and `do_quote` are mutually exclusivez20.8z_`Defaults.disable_web_page_preview` is deprecated. Use `Defaults.link_preview_options` instead.   )
stacklevel)is_disabledz@`Defaults.quote` is deprecated. Use `Defaults.do_quote` instead.)	r   r   r!   explanation_parse_moder    r   text_parse_moder   question_parse_mode)r   r   r   r   r   r   
ValueErrorr
   r   r   r   r   r   getattr)selfr   r   r   r   r   r   r   r   r    r!   kwargvalues                A/app/.venv/lib/python3.13/site-packages/telegram/ext/_defaults.py__init__Defaults.__init__   s     +55I"<W)(.!0?#/4H4T_  !5LMM#/%?
  HZ4HD& *>&%^ 	 .3N%N

E D(E ,1""5)

    returnc           
          [        U R                  U R                  U R                  U R                  U R
                  U R                  U R                  U R                  45      $ )zBuilds 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__Defaults.__hash__   sX       **--11

%%	
 	
r1   otherc                 r   ^ ^ [        T[        5      (       a   [        UU 4S jT R                   5       5      $ g)zDefines 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   V   >#    U  H  n[        TU5      [        TU5      :H  v   M      g 7fN)r*   ).0attrr8   r+   s     r.   	<genexpr>"Defaults.__eq__.<locals>.<genexpr>   s$     ^~twtT*geT.BB~s   &)F)
isinstancer   all	__slots__)r+   r8   s   ``r.   __eq__Defaults.__eq__   s*     eX&&^t~~^^^r1   c                     U R                   $ r;   )r   r5   s    r.   api_defaultsDefaults.api_defaults   s    !!!r1   c                     U R                   $ )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   r5   s    r.   r   Defaults.parse_mode       
 r1   _c                     [        S5      e)NzBYou can not assign a new value to parse_mode after initialization.AttributeErrorr+   rL   s     r.   r   rJ      s    abbr1   c                     U R                   $ )z|:obj:`str`: Optional. Alias for :attr:`parse_mode`, used for
the corresponding parameter of :meth:`telegram.Bot.send_poll`.
rI   r5   s    r.   r&   Defaults.explanation_parse_mode   rK   r1   c                     [        S5      e)NzNYou can not assign a new value to explanation_parse_mode after initialization.rN   rP   s     r.   r&   rR      s    \
 	
r1   c                     U R                   $ )z~:obj:`str`: Optional. Alias for :attr:`parse_mode`, used for
the corresponding parameter of :meth:`telegram.ReplyParameters`.
rI   r5   s    r.   quote_parse_modeDefaults.quote_parse_mode  rK   r1   c                     [        S5      e)NzHYou can not assign a new value to quote_parse_mode after initialization.rN   rP   s     r.   rU   rV   
  s    V
 	
r1   c                     U R                   $ )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
rI   r5   s    r.   r'   Defaults.text_parse_mode  s     r1   c                     [        S5      e)NzGYou can not assign a new value to text_parse_mode after initialization.rN   rP   s     r.   r'   rY     s    U
 	
r1   c                     U R                   $ )z:obj:`str`: Optional. Alias for :attr:`parse_mode`, used for
the corresponding parameter of :meth:`telegram.Bot.send_poll`.

.. versionadded:: 21.2
rI   r5   s    r.   r(   Defaults.question_parse_mode   s     r1   c                     [        S5      e)NzKYou can not assign a new value to question_parse_mode after initialization.rN   rP   s     r.   r(   r\   )  s    Y
 	
r1   c                     U R                   $ )zd:obj:`bool`: Optional. Sends the message silently. Users will
receive a notification with no sound.
)r   r5   s    r.   r   Defaults.disable_notification/  s    
 )))r1   c                     [        S5      e)NzLYou can not assign a new value to disable_notification after initialization.rN   rP   s     r.   r   r_   6  s    Z
 	
r1   c                 T    U R                   (       a  U R                   R                  $ S$ )z:obj:`bool`: Optional. Disables link previews for links in all outgoing
messages.

.. deprecated:: 20.8
    Use :attr:`link_preview_options` instead. This attribute will be removed in future
    versions.
N)r   r%   r5   s    r.   r   !Defaults.disable_web_page_preview<  s$     :>9S9St))55]Y]]r1   c                     [        S5      e)NzPYou can not assign a new value to disable_web_page_preview after initialization.rN   rP   s     r.   r   rb   G  s    ^
 	
r1   c                     U R                   $ )z~:obj:`bool`: Optional. Pass :obj:`True`, if the message
should be sent even if the specified replied-to message is not found.
)r   r5   s    r.   r   $Defaults.allow_sending_without_replyM  s    
 000r1   c                     [        S5      e)NzSYou can not assign a new value to allow_sending_without_reply after initialization.rN   rP   s     r.   r   re   T  s    a
 	
r1   c                 8    U R                   b  U R                   $ S$ )z:obj:`bool`: Optional. |reply_quote|

.. deprecated:: 20.8
    Use :attr:`do_quote` instead. This attribute will be removed in future
    versions.
Nr   r5   s    r.   r   Defaults.quoteZ  s     "&!;t~~EEr1   c                     [        S5      e)Nz=You can not assign a new value to quote after initialization.rN   rP   s     r.   r   ri   d      \]]r1   c                     U R                   $ )zZ:obj:`tzinfo`: A timezone to be used for all date(time) objects appearing
throughout PTB.
)r   r5   s    r.   r   Defaults.tzinfoh  s    
 ||r1   c                     [        S5      e)Nz>You can not assign a new value to tzinfo after initialization.rN   rP   s     r.   r   rm   o  s    ]^^r1   c                     U R                   $ )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   r5   s    r.   r   Defaults.blocks  s     {{r1   c                     [        S5      e)Nz=You can not assign a new value to block after initialization.rN   rP   s     r.   r   rp   {  rk   r1   c                     U R                   $ )zu:obj:`bool`: Optional. Protects the contents of the sent message from forwarding and
saving.

.. versionadded:: 20.0
)r   r5   s    r.   r   Defaults.protect_content  s     $$$r1   c                     [        S5      e)NzEYou can't assign a new value to protect_content after initialization.rN   rP   s     r.   r   rs     s    S
 	
r1   c                     U R                   $ )z:class:`telegram.LinkPreviewOptions`: Optional. Link preview generation options for all
outgoing messages.

.. versionadded:: 20.8
)r   r5   s    r.   r    Defaults.link_preview_options  s     )))r1   c                     U R                   $ )z=:obj:`bool`: Optional. |reply_quote|

.. versionadded:: 20.8
rh   r5   s    r.   r!   Defaults.do_quote  s     ~~r1   )&__name__
__module____qualname____firstlineno____doc__rB   r   r   strbooldatetimer   r/   intr6   objectrC   propertydictr   rF   r   setterr   r&   rU   r'   r(   r   r	   r   r   r   r   r   r    r!   __static_attributes__ r1   r.   r   r      s   Un
I %)/337 $"%6:*.?C#'B2SMB2 'tnB2 #+4.	B2
 ~B2 B2 B2 &.d^B2 "$B2 '';<B2 4.B2H
# 
(
F 
t 
 "d38n " "  HSM     cF cx c c       ""
 
8 
 #

  (3-     
& 
X 
 

  #     
 
H 
 

  Xc]     
V 
 
  

 *htn * *   
f 
 
 !

 ^(4. ^ ^ $$
& 
X 
 %

 1Xd^ 1 1 !''
V 
 
 (

 Fx~ F F \\^v ^( ^ ^    ]]_ _8 _ _ t   \\^v ^( ^ ^ %$ % % 
 
H 
 

 *h/C&D * * (4.  r1   r   )r}   r   typingr   r   r   r   telegramr   telegram._utils.datetimer   telegram._utils.typesr	   telegram._utils.warningsr
   telegram.warningsr   r   r   r1   r.   <module>r      s?   & c  1 1 ' ( * ) 3 ~ ~ ~r1   