
    Yi                         S r SSKJr  SSKJ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Jr  SSKJrJr   " S	 S
\\\\4   5      rg)z6This module contains the ChatJoinRequestHandler class.    )Optional)Update)DEFAULT_TRUE)RTSCTDVType)BaseHandler)parse_chat_idparse_username)CCTHandlerCallbackc                      ^  \ rS rSrSrSrSS\4SSS\\\	\
4   S\\\      S	\\\      S
\\   4
U 4S jjjrS\S\4S jrSrU =r$ )ChatJoinRequestHandler   a  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U ]  XS9  [        U5      U l        [	        U5      U l        g )N)r   )super__init__r
   r   r   r   )r   r   r   r   r   	__class__s        X/app/.venv/lib/python3.13/site-packages/telegram/ext/_handlers/chatjoinrequesthandler.pyr   ChatJoinRequestHandler.__init__S   s-     	/&w/(2    updatereturnc                 N   [        U[        5      (       a  UR                  (       a  U R                  (       d  U R                  (       d  gUR                  R
                  R                  U R                  ;   a  gUR                  R                  R                  U R                  ;   $ 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   chat_join_requestr   r   chatid	from_userr   )r   r   s     r   check_update#ChatJoinRequestHandler.check_update_   sn     ff%%&*B*B>>$//'',,//4>>A++55>>$//QQr   )__name__
__module____qualname____firstlineno____doc__	__slots__r   r   r   r   r   r   r   intstrr   boolr   objectr'   __static_attributes____classcell__)r   s   @r   r   r      s    ,\I '+'+*
3/
3!&#r/2
3 #c(#
3 3s8$	
3
 d|
3 
36 d  r   r   N)r-   typingr   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>r=      s;   & =   5 1 1 : M :P[b9 Pr   