L idZddlZddlmZddlmZmZmZddlmZddl m Z ddl m Z ddl mZdd lmZmZed ZGd d eeeefZy) z7This module contains the PreCheckoutQueryHandler class.N)Pattern)OptionalTypeVarUnion)Update) DEFAULT_TRUE)DVType) BaseHandler)CCTHandlerCallbackRTc veZdZdZdZedfdddeeee fde e de e eeefffd Zd ed e fd ZxZS) PreCheckoutQueryHandleraHandler class to handle Telegram :attr:`telegram.Update.pre_checkout_query`. Warning: When setting :paramref:`block` to :obj:`False`, you cannot rely on adding custom attributes to :class:`telegram.ext.CallbackContext`. See its docs for more info. Examples: :any:`Payment Bot ` Args: callback (:term:`coroutine function`): The callback function for this handler. Will be called when :meth:`check_update` has determined that an update should be processed by this handler. Callback signature:: async def callback(update: Update, context: CallbackContext) The return value of the callback is usually ignored except for the special case of :class:`telegram.ext.ConversationHandler`. block (:obj:`bool`, optional): Determines whether the return value of the callback should be awaited before processing the next handler in :meth:`telegram.ext.Application.process_update`. Defaults to :obj:`True`. .. seealso:: :wiki:`Concurrency` pattern (:obj:`str` | :func:`re.Pattern `, optional): Optional. Regex pattern to test :attr:`telegram.PreCheckoutQuery.invoice_payload` against. .. versionadded:: 20.8 Attributes: callback (:term:`coroutine function`): The callback function for this handler. block (:obj:`bool`): Determines whether the callback will run in a blocking way.. pattern (:obj:`str` | :func:`re.Pattern `, optional): Optional. Regex pattern to test :attr:`telegram.PreCheckoutQuery.invoice_payload` against. .. versionadded:: 20.8 )patternNselfz PreCheckoutQueryHandler[CCT, RT]callbackblockrcpt||||tj||_yd|_y)N)r)super__init__recompiler)rrrr __class__s t/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/telegram/ext/_handlers/precheckoutqueryhandler.pyrz PreCheckoutQueryHandler.__init__Ks3 /FMFYrzz'/B _c updatereturnct|trL|jr@|jj}|jr|jj |ryyyy)zDetermines whether an update should be passed to this handler's :attr:`callback`. Args: update (:class:`telegram.Update` | :obj:`object`): Incoming update. Returns: :obj:`bool` TF) isinstancerpre_checkout_queryinvoice_payloadrmatch)rrr!s r check_updatez$PreCheckoutQueryHandler.check_updateUsP ff %&*C*C$77GGO||<<%%o6r)__name__ __module__ __qualname____doc__ __slots__rr rr r r boolrrstrrrobjectr# __classcell__)rs@rrr"s{$LI +6: d0d!&#r/2dd|d%WS\ 123 d6drr)r'rrtypingrrrtelegramrtelegram._utils.defaultvaluertelegram._utils.typesr "telegram.ext._handlers.basehandlerr telegram.ext._utils.typesr r r rrrr4sG&> ++5(:: T]Dk&#r/:Dr