
    i                         d Z ddlmZmZ ddlmZ ddlmZ ddlm	Z	m
Z
 ddlmZ ddlmZmZ ddlmZmZ  ed	          Z G d
 deeef                   ZdS )z9This module contains the BusinessConnectionHandler class.    )OptionalTypeVar)Update)DEFAULT_TRUE)SCTDVType)BaseHandler)parse_chat_idparse_username)CCTHandlerCallbackRTc            
            e Zd ZdZdZddefdeeee	f         de
ee                  de
ee                  dee         f fdZd	ed
efdZ xZS )BusinessConnectionHandlerah  Handler class to handle Telegram
    :attr:`Business Connections <telegram.Update.business_connection>`.

    .. versionadded:: 21.1

    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)
        user_id (:obj:`int` | Collection[:obj:`int`], optional): Filters requests to allow only
            those which are from the specified user ID(s).

        username (:obj:`str` | Collection[:obj:`str`], optional): Filters requests to allow only
            those which are from the specified username(s).

        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`
    Attributes:
        callback (:term:`coroutine function`): The callback function for this handler.
        block (:obj:`bool`): Determines whether the return value of the callback should be
            awaited before processing the next handler in
            :meth:`telegram.ext.Application.process_update`.
    )	_user_ids
_usernamesNcallbackuser_idusernameblockc                     t                                          ||           t          |          | _        t	          |          | _        d S )N)r   )super__init__r
   r   r   r   )selfr   r   r   r   	__class__s        v/var/www/html/crypto-bot/backend/venv/lib/python3.11/site-packages/telegram/ext/_handlers/businessconnectionhandler.pyr   z"BusinessConnectionHandler.__init__C   sD     	///&w//(22    updatereturnc                     t          |t                    rI|j        rB| j        s	| j        sdS |j        j        j        | j        v rdS |j        j        j        | j        v S dS )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   business_connectionr   r   useridr   )r   r   s     r   check_updatez&BusinessConnectionHandler.check_updateO   sp     ff%% 	O&*D 	O> $/ t).1T^CCt-2;tNNur   )__name__
__module____qualname____doc__	__slots__r   r   r   r   r   r   r   intstrr   boolr   objectr%   __classcell__)r   s   @r   r   r       s         :I '+'+*
3 
3!&#r/2
3 #c(#
3 3s8$	
3
 d|
3 
3 
3 
3 
3 
36 d        r   r   N)r)   typingr   r   telegramr   telegram._utils.defaultvaluer   telegram._utils.typesr   r   "telegram.ext._handlers.basehandlerr	   #telegram.ext._utils._update_parsingr
   r   telegram.ext._utils.typesr   r   r   r    r   r   <module>r8      s   & @ ? $ $ $ $ $ $ $ $       5 5 5 5 5 5 - - - - - - - - : : : : : : M M M M M M M M : : : : : : : :WT]]? ? ? ? ?FCK 8 ? ? ? ? ?r   