L i6~dZddlZddlmZmZmZmZmZddl m Z ddl m Z ddl mZerddlmZeGdd Zy) z\This module contains the class Defaults, which allows passing default values to Application.N) TYPE_CHECKINGAnyNoReturnOptionalfinal)UTC)warn)PTBDeprecationWarning)LinkPreviewOptionsceZdZdZdZddedddddfdeedeede jded eed eed ed d eefdZ de fdZ dedefdZedeeeffdZedeefdZej*dedefdZedeefdZej*dedefdZedeefdZej*dedefdZedeefdZej*dedefdZedeefdZej*dedefdZedeefdZej*dedefd Zedeefd!Zej*dedefd"Zede jfd#Z e j*dedefd$Z edefd%Zej*dedefd&Zedeefd'Zej*dedefd(Zeded fd)Zedeefd*Z y)+DefaultsaConvenience Class to gather all parameters with a (user defined) default value .. seealso:: :wiki:`Architecture Overview `, :wiki:`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_modedisable_notificationtzinfoblockallow_sending_without_replyprotect_contentlink_preview_optionsr do_quotec >||_||_||_||_||_||_dt |jjvrttddd||_ ||_ i|_ dD] } t|| } | | |j| <"y)Npytzz21.10zPSupport for pytz timezones is deprecated and will be removed in future versions.)versionmessage)r" stacklevel) rrrexplanation_parse_moderrtext_parse_moderquestion_parse_mode)rrrrrrstr __class__r r rrrgetattr) selfrrrrrrrrkwargvalues \/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/telegram/ext/_defaults.py__init__zDefaults.__init__s+55I"z"Defaults.__eq__..s$^twtT*geT.BB^s#&F) isinstancer all __slots__)r+r6s``r.__eq__zDefaults.__eq__s' eX &^t~~^^ ^r0c|jSr9)rr4s r. api_defaultszDefaults.api_defaultss!!!r0c|jS)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. rr4s r.rzDefaults.parse_mode r0_ctd)NzBYou can not assign a new value to parse_mode after initialization.AttributeErrorr+rFs r.rzDefaults.parse_modesabbr0c|jS)z:obj:`str`: Optional. Alias for :attr:`parse_mode`, used for the corresponding parameter of :meth:`telegram.Bot.send_poll`. rDr4s r.r%zDefaults.explanation_parse_moderEr0ctd)NzNYou can not assign a new value to explanation_parse_mode after initialization.rHrJs r.r%zDefaults.explanation_parse_modes \  r0c|jS)z:obj:`str`: Optional. Alias for :attr:`parse_mode`, used for the corresponding parameter of :meth:`telegram.ReplyParameters`. rDr4s r.quote_parse_modezDefaults.quote_parse_moderEr0ctd)NzHYou can not assign a new value to quote_parse_mode after initialization.rHrJs r.rNzDefaults.quote_parse_modes V  r0c|jS)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 rDr4s r.r&zDefaults.text_parse_modesr0ctd)NzGYou can not assign a new value to text_parse_mode after initialization.rHrJs r.r&zDefaults.text_parse_modes U  r0c|jS)z:obj:`str`: Optional. Alias for :attr:`parse_mode`, used for the corresponding parameter of :meth:`telegram.Bot.send_poll`. .. versionadded:: 21.2 rDr4s r.r'zDefaults.question_parse_mode sr0ctd)NzKYou can not assign a new value to question_parse_mode after initialization.rHrJs r.r'zDefaults.question_parse_modes Y  r0c|jS)zt:obj:`bool`: Optional. Sends the message silently. Users will receive a notification with no sound. )rr4s r.rzDefaults.disable_notifications )))r0ctd)NzLYou can not assign a new value to disable_notification after initialization.rHrJs r.rzDefaults.disable_notification"s Z  r0c|jS)z:obj:`bool`: Optional. Pass :obj:`True`, if the message should be sent even if the specified replied-to message is not found. )rr4s r.rz$Defaults.allow_sending_without_reply(s 000r0ctd)NzSYou can not assign a new value to allow_sending_without_reply after initialization.rHrJs r.rz$Defaults.allow_sending_without_reply/s a  r0c|jS)zj:obj:`tzinfo`: A timezone to be used for all date(time) objects appearing throughout PTB. )rr4s r.rzDefaults.tzinfo5s ||r0ctd)Nz>You can not assign a new value to tzinfo after initialization.rHrJs r.rzDefaults.tzinfo<s]^^r0c|jS)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`. )rr4s r.rzDefaults.block@s {{r0ctd)Nz=You can not assign a new value to block after initialization.rHrJs r.rzDefaults.blockHs\]]r0c|jS)z:obj:`bool`: Optional. Protects the contents of the sent message from forwarding and saving. .. versionadded:: 20.0 )rr4s r.rzDefaults.protect_contentLs$$$r0ctd)NzEYou can't assign a new value to protect_content after initialization.rHrJs r.rzDefaults.protect_contentUs S  r0c|jS)z:class:`telegram.LinkPreviewOptions`: Optional. Link preview generation options for all outgoing messages. .. versionadded:: 20.8 )rr4s r.rzDefaults.link_preview_options[s)))r0c|jS)zM:obj:`bool`: Optional. |reply_quote| .. versionadded:: 20.8 )rr4s r.rzDefaults.do_quoteds ~~r0)!__name__ __module__ __qualname____doc__r?rrr(booldtmrr/intr5objectr@propertydictrrBrsetterrr%rNr&r'rrrrrrr0r.r r sPd I%)/3 6:*.?C#'12SM12'tn12 12  12 &.d^ 12"$12'';<124.12f # ( F t "d38n"" HSM  cFcxcc    ""  8 #  (3-   & X   #    H   Xc]   V    *htn**    f  ! 1Xd^11 !'' V  (    ]]__8__t \\^v^(^^%$%%  H  *h/C&D**(4.r0r )rcdatetimeretypingrrrrrtelegram._utils.datetimertelegram._utils.warningsr telegram.warningsr telegramr r rkr0r.rrs?&c@@()3+IIIr0