§
    ­eîic  ã                   ó�   — d Z ddlmZ ddlmZ ddlmZmZmZ ddl	m
Z
 ddlmZmZ ddlmZmZ  G d„ d	e
eeef         ¦  «        Zd
S )z6This module contains the ChatJoinRequestHandler class.é    )ÚUpdate)ÚDEFAULT_TRUE)ÚRTÚSCTÚDVType)ÚBaseHandler)Úparse_chat_idÚparse_username)ÚCCTÚHandlerCallbackc                   ó–   ‡ — e Zd ZdZdZddefdddeeee	f         de
e         dz  de
e         dz  d	ee         f
ˆ fd
„Zdedefd„Zˆ xZS )ÚChatJoinRequestHandlera  Handler class to handle Telegram updates that contain
    :attr:`telegram.Update.chat_join_request`.

    Note:
        If neither of :paramref:`username` and the :paramref:`chat_id` are passed, this handler
        accepts *any* join request. Otherwise, this handler accepts all requests to join chats
        for which the chat ID is listed in :paramref:`chat_id` or the username is listed in
        :paramref:`username`, or both.

        .. versionadded:: 20.0

    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.

    .. versionadded:: 13.8

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

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

            .. versionadded:: 20.0
        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 callback will run in a blocking way..

    )Ú	_chat_idsÚ
_usernamesNÚselfzChatJoinRequestHandler[CCT, RT]ÚcallbackÚchat_idÚusernameÚblockc                 óž   •— t          ¦   «                              ||¬¦  «         t          |¦  «        | _        t	          |¦  «        | _        d S )N)r   )ÚsuperÚ__init__r	   r   r
   r   )r   r   r   r   r   Ú	__class__s        €úq/home/div/.hermes/hermes-agent/venv/lib/python3.11/site-packages/telegram/ext/_handlers/chatjoinrequesthandler.pyr   zChatJoinRequestHandler.__init__Q   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 )zäDetermines 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   Úchat_join_requestr   r   ÚchatÚidÚ	from_userr   )r   r   s     r   Úcheck_updatez#ChatJoinRequestHandler.check_update]   sp   € õ �f�fÑ%Ô%ð 	R¨&Ô*Bð 	RØ”>ð ¨$¬/ð Ø�tØÔ'Ô,Ô/°4´>ÐAÐAØ�tØÔ+Ô5Ô>À$Ä/ÐQÐQØˆur   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú	__slots__r   r   r   r   r   r   ÚintÚstrr   Úboolr   Úobjectr$   Ú__classcell__)r   s   @r   r   r      sÎ   ø€ € € € € ð,ð ,ð\€Ið $(Ø$(Ø*ð
3ð 
3Ø/ð
3à! &¨#¨r /Ô2ð
3ð �S”˜D‘ð
3ð �c”(˜T‘/ð	
3ð
 �dŒ|ð
3ð 
3ð 
3ð 
3ð 
3ð 
3ð 6ð ¨dð ð ð ð ð ð ð ð r   r   N)r(   Útelegramr   Útelegram._utils.defaultvaluer   Útelegram._utils.typesr   r   r   Ú"telegram.ext._handlers.basehandlerr   Ú#telegram.ext._utils._update_parsingr	   r
   Útelegram.ext._utils.typesr   r   r   © r   r   ú<module>r6      sÚ   ðð& =Ð <à Ð Ð Ð Ð Ð Ø 5Ð 5Ð 5Ð 5Ð 5Ð 5Ø 1Ð 1Ð 1Ð 1Ð 1Ð 1Ð 1Ð 1Ð 1Ð 1Ø :Ð :Ð :Ð :Ð :Ð :Ø MÐ MÐ MÐ MÐ MÐ MÐ MÐ MØ :Ð :Ð :Ð :Ð :Ð :Ð :Ð :ðPð Pð Pð Pð P˜[¨°°b¨Ô9ñ Pô Pð Pð Pð Pr   