
    YiI"                         S r SSKrSSK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S	KJr  SS
KJrJr  \(       a  SSKJr   " S S\
5      rg)zJThis module contains an object that represents a Telegram ChatJoinRequest.    N)TYPE_CHECKINGOptional)Chat)ChatInviteLink)TelegramObject)User)extract_tzinfo_from_defaultsfrom_timestamp)DEFAULT_NONE)JSONDictODVInput)Botc                   d  ^  \ rS rSrSrSr  SSS.S\S\S\R                  S	\	S
\
\   S\
\   S\
\   4U 4S jjjjr\ SS\
\   S\
S   S\
S    4U 4S jjj5       r\\\\SS.S\\   S\\   S\\   S\\   S\
\   S\4S jjr\\\\SS.S\\   S\\   S\\   S\\   S\
\   S\4S jjrSrU =r$ )ChatJoinRequest#   al  This object represents a join request sent to a chat.

Objects of this class are comparable in terms of equality. Two objects of this class are
considered equal, if their :attr:`chat`, :attr:`from_user` and :attr:`date` are equal.

Note:
    * Since Bot API 5.5, bots are allowed to contact users who sent a join request to a chat
      where the bot is an administrator with the
      :attr:`~telegram.ChatMemberAdministrator.can_invite_users` administrator right - even
      if the user never interacted with the bot before.
    * Telegram does not guarantee that :attr:`from_user.id <from_user>` coincides with the
      ``chat_id`` of the user. Please use :attr:`user_chat_id` to contact the user in
      response to their join request.

.. versionadded:: 13.8
.. versionchanged:: 20.1
   In Bot API 6.5 the argument :paramref:`user_chat_id` was added, which changes the position
   of the optional arguments :paramref:`bio` and :paramref:`invite_link`.

Args:
    chat (:class:`telegram.Chat`): Chat to which the request was sent.
    from_user (:class:`telegram.User`): User that sent the join request.
    date (:class:`datetime.datetime`): Date the request was sent.

        .. versionchanged:: 20.3
            |datetime_localization|
    user_chat_id (:obj:`int`): Identifier of a private chat with the user who sent the join
        request. This number may have more than 32 significant bits and some programming
        languages may have difficulty/silent defects in interpreting it. But it has at most 52
        significant bits, so a 64-bit integer or double-precision float type are safe for
        storing this identifier. The bot can use this identifier for 5 minutes to send messages
        until the join request is processed, assuming no other administrator contacted the
        user.

        .. versionadded:: 20.1
    bio (:obj:`str`, optional): Bio of the user.
    invite_link (:class:`telegram.ChatInviteLink`, optional): Chat invite link that was used
        by the user to send the join request.

Attributes:
    chat (:class:`telegram.Chat`): Chat to which the request was sent.
    from_user (:class:`telegram.User`): User that sent the join request.
    date (:class:`datetime.datetime`): Date the request was sent.

        .. versionchanged:: 20.3
            |datetime_localization|
    user_chat_id (:obj:`int`): Identifier of a private chat with the user who sent the join
        request. This number may have more than 32 significant bits and some programming
        languages may have difficulty/silent defects in interpreting it. But it has at most 52
        significant bits, so a 64-bit integer or double-precision float type are safe for
        storing this identifier. The bot can use this identifier for 24 hours to send messages
        until the join request is processed, assuming no other administrator contacted the
        user.

        .. versionadded:: 20.1
    bio (:obj:`str`): Optional. Bio of the user.
    invite_link (:class:`telegram.ChatInviteLink`): Optional. Chat invite link that was used
        by the user to send the join request.

        Note:
            When a user joins a *public* group via an invite link, this attribute may not
            be present. However, this behavior is undocument and may be subject to change.
            See `this GitHub thread <https://github.com/tdlib/telegram-bot-api/issues/428>`_
            for some discussion.

)biochatdate	from_userinvite_linkuser_chat_idN
api_kwargsr   r   r   r   r   r   r   c                   > [         TU ]  US9  Xl        X l        X0l        X@l        XPl        X`l        U R                  U R                  U R                  4U l        U R                  5         g )Nr   )
super__init__r   r   r   r   r   r   	_id_attrs_freeze)	selfr   r   r   r   r   r   r   	__class__s	           D/app/.venv/lib/python3.13/site-packages/telegram/_chatjoinrequest.pyr   ChatJoinRequest.__init__i   sZ     	J/	('+	!- #&5@))T^^TYY?    databotr   returnc                   > U R                  U5      nU(       d  g[        U5      n[        R                  " UR	                  S5      U5      US'   [
        R                  " UR                  SS5      U5      US'   [        UR	                  SS5      US9US'   [        R                  " UR	                  S5      U5      US'   [        TU ]  XS9$ )	z,See :meth:`telegram.TelegramObject.de_json`.Nr   fromr   r   )tzinfor   )r$   r%   )
_parse_datar	   r   de_jsongetr   popr
   r   r   )clsr$   r%   
loc_tzinfor    s       r!   r+   ChatJoinRequest.de_json   s    
 t$ 2#6
||DHHV$4c:V LL&$)?E[%dhhvt&<ZPV,44TXXm5LcR]wD22r#   )read_timeoutwrite_timeoutconnect_timeoutpool_timeoutr   r1   r2   r3   r4   c          
         #    U R                  5       R                  U R                  R                  U R                  R                  UUUUUS9I Sh  vN $  N7f)a@  Shortcut for::

    await bot.approve_chat_join_request(
        chat_id=update.effective_chat.id, user_id=update.effective_user.id, *args, **kwargs
    )

For the documentation of the arguments, please see
:meth:`telegram.Bot.approve_chat_join_request`.

Returns:
    :obj:`bool`: On success, :obj:`True` is returned.

chat_iduser_idr1   r2   r3   r4   r   N)get_botapprove_chat_join_requestr   idr   r   r1   r2   r3   r4   r   s         r!   approveChatJoinRequest.approve   V     , \\^==IILLNN%%%'+%! > 
 
 	
 
   AAAAc          
         #    U R                  5       R                  U R                  R                  U R                  R                  UUUUUS9I Sh  vN $  N7f)a@  Shortcut for::

    await bot.decline_chat_join_request(
        chat_id=update.effective_chat.id, user_id=update.effective_user.id, *args, **kwargs
    )

For the documentation of the arguments, please see
:meth:`telegram.Bot.decline_chat_join_request`.

Returns:
    :obj:`bool`: On success, :obj:`True` is returned.

r6   N)r9   decline_chat_join_requestr   r;   r   r<   s         r!   declineChatJoinRequest.decline   r?   r@   )r   r   r   r   r   r   r   )NN)N)__name__
__module____qualname____firstlineno____doc__	__slots__r   r   datetimeintr   strr   r   r   classmethodr+   r   r   floatboolr=   rC   __static_attributes____classcell__)r    s   @r!   r   r   #   s   AF TI "04 *.  	
  c] n- X& 4 >B3H%3,4UO3	#	$3 3, )5)5+7(4)-
 uo
  	

 "%
 uo
 X&
 

F )5)5+7(4)-
 uo
  	

 "%
 uo
 X&
 

 
r#   r   )rI   rK   typingr   r   telegram._chatr   telegram._chatinvitelinkr   telegram._telegramobjectr   telegram._userr   telegram._utils.datetimer	   r
   telegram._utils.defaultvaluer   telegram._utils.typesr   r   telegramr   r    r#   r!   <module>r]      s:   & Q  *  3 3  Q 5 4r
n r
r#   