
    Yi                         S r SSKrSSKJr  SSK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Jr  \" S
5      r " S S\\\\4   5      rg)z7This module contains the PreCheckoutQueryHandler class.    N)Pattern)OptionalTypeVarUnion)Update)DEFAULT_TRUE)DVType)BaseHandler)CCTHandlerCallbackRTc                      ^  \ rS rSrSrSr\S4SSS\\\	\
4   S\\   S	\\\\\   4      4U 4S
 jjjrS\S\4S jrSrU =r$ )PreCheckoutQueryHandler#   aY  Handler 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 <examples.paymentbot>`

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 <re.compile>`, 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 <re.compile>`, optional): Optional. Regex pattern
        to test :attr:`telegram.PreCheckoutQuery.invoice_payload` against.

        .. versionadded:: 20.8

)patternNselfz PreCheckoutQueryHandler[CCT, RT]callbackblockr   c                 l   > [         TU ]  XS9  Ub  [        R                  " U5      U l        g S U l        g )N)r   )super__init__recompiler   )r   r   r   r   	__class__s       Y/app/.venv/lib/python3.13/site-packages/telegram/ext/_handlers/precheckoutqueryhandler.pyr    PreCheckoutQueryHandler.__init__L   s1     	/FMFYrzz'/B_c    updatereturnc                     [        U[        5      (       a\  UR                  (       aK  UR                  R                  nU R                  (       a#  U R                  R                  U5      (       a  g ggg)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)
isinstancer   pre_checkout_queryinvoice_payloadr   match)r   r   r#   s      r   check_update$PreCheckoutQueryHandler.check_updateV   s[     ff%%&*C*C$77GGO||<<%%o66 7  r   )__name__
__module____qualname____firstlineno____doc__	__slots__r   r   r   r   r   r	   boolr   r   strr   r   objectr%   __static_attributes____classcell__)r   s   @r   r   r   #   s    $L I
 +6:	d0d!&#r/2d d|d %WS\ 123	d d6 d  r   r   )r+   r   r   typingr   r   r   telegramr   telegram._utils.defaultvaluer   telegram._utils.typesr	   "telegram.ext._handlers.basehandlerr
   telegram.ext._utils.typesr   r   r   r    r   r   <module>r9      sI   & > 
  + +  5 ( : :T]Dk&#r/: Dr   