
    ՟f)                         d Z ddlmZmZmZmZ ddlmZ ddlm	Z	 ddl
mZ ddlmZ erddlmZ  G d d	e	      Z G d
 de	      Z G d de	      Zy)zOThis module contains two objects used for request chats/users service messages.    )TYPE_CHECKINGOptionalSequenceTuple)	PhotoSize)TelegramObject)parse_sequence_arg)JSONDict)Botc            	       ~     e Zd ZdZdZdddeded   dee   f fd	Z	e
	 dd
ee   ded   ded    f fd       Z xZS )UsersShareda	  
    This object contains information about the user whose identifier was shared with the bot
    using a :class:`telegram.KeyboardButtonRequestUsers` button.

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

    .. versionadded:: 20.8
       Bot API 7.0 replaces ``UserShared`` with this class. The only difference is that now
       the ``user_ids`` is a sequence instead of a single integer.

    .. versionchanged:: 21.1
       The argument :attr:`users` is now considered for the equality comparison instead of
       ``user_ids``.

    .. versionremoved:: 21.2
       Removed the deprecated argument and attribute ``user_ids``.

    Args:
        request_id (:obj:`int`): Identifier of the request.
        users (Sequence[:class:`telegram.SharedUser`]): Information about users shared with the
            bot.

            .. versionadded:: 21.1

            .. versionchanged:: 21.2
               This argument is now required.

    Attributes:
        request_id (:obj:`int`): Identifier of the request.
        users (Tuple[:class:`telegram.SharedUser`]): Information about users shared with the
            bot.

            .. versionadded:: 21.1
    )
request_idusersN
api_kwargsr   r   
SharedUserr   c                    t         |   |       || _        t        |      | _        | j                  | j                  f| _        | j                          y Nr   )super__init__r   r	   r   	_id_attrs_freeze)selfr   r   r   	__class__s       K/var/www/cvtools/html/venv/lib/python3.12/site-packages/telegram/_shared.pyr   zUsersShared.__init__F   sE     	J/)-?-F
//4::6    databotr   returnc                     | j                  |      }|syt        j                  |j                  d      |      |d<   i }|j                  d      x}rd|i}t        |   |||      S ),See :meth:`telegram.TelegramObject.de_json`.Nr   user_ids)r   r   r   )_parse_datar   de_listgetr   _de_json)clsr   r   r   r"   r   s        r   de_jsonzUsersShared.de_jsonU   st    
 t$"**488G+<cBW
 xx
++8+$h/JwTszJJr   N)__name__
__module____qualname____doc__	__slots__intr   r   r
   r   classmethodr(   __classcell__r   s   @r   r   r      s    "H (I *. %
 X& >BKH%K,4UOK	-	 K Kr   r   c                        e Zd ZdZdZ	 	 	 ddddededee   dee   d	eee	      d
ee
   f fdZe	 ddee
   ded   ded    f fd       Z xZS )
ChatShareda  
    This object contains information about the chat whose identifier was shared with the bot
    using a :class:`telegram.KeyboardButtonRequestChat` button.

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

    .. versionadded:: 20.1

    Args:
        request_id (:obj:`int`): Identifier of the request.
        chat_id (:obj:`int`): Identifier of the shared user. This number may be greater than 32
            bits and some programming languages may have difficulty/silent defects in interpreting
            it. But it is smaller than 52 bits, so a signed 64-bit integer or double-precision
            float type are safe for storing this identifier.
        title (:obj:`str`, optional): Title of the chat, if the title was requested by the bot.

            .. versionadded:: 21.1
        username (:obj:`str`, optional): Username of the chat, if the username was requested by
            the bot and available.

            .. versionadded:: 21.1
        photo (Sequence[:class:`telegram.PhotoSize`], optional): Available sizes of the chat photo,
            if the photo was requested by the bot

            .. versionadded:: 21.1

    Attributes:
        request_id (:obj:`int`): Identifier of the request.
        chat_id (:obj:`int`): Identifier of the shared user. This number may be greater than 32
            bits and some programming languages may have difficulty/silent defects in interpreting
            it. But it is smaller than 52 bits, so a signed 64-bit integer or double-precision
            float type are safe for storing this identifier.
        title (:obj:`str`): Optional. Title of the chat, if the title was requested by the bot.

            .. versionadded:: 21.1
        username (:obj:`str`): Optional. Username of the chat, if the username was requested by
            the bot and available.

            .. versionadded:: 21.1
        photo (Tuple[:class:`telegram.PhotoSize`]): Optional. Available sizes of the chat photo,
            if the photo was requested by the bot

            .. versionadded:: 21.1
    )chat_idphotor   titleusernameNr   r   r5   r7   r8   r6   r   c                    t         |   |       || _        || _        || _        || _        t        |      | _        | j                  | j                  f| _        | j                          y r   )
r   r   r   r5   r7   r8   r	   r6   r   r   )r   r   r5   r7   r8   r6   r   r   s          r   r   zChatShared.__init__   sZ     	J/)#$)
'/6H6O
//4<<8r   r   r   r   r   c                     | j                  |      }|syt        j                  |j                  d      |      |d<   t        |   ||      S r!   Nr6   )r   r   r#   r   r$   r%   r   r(   r'   r   r   r   s      r   r(   zChatShared.de_json   K    
 t$!))$((7*;SAWwDc22r   )NNNr)   r*   r+   r,   r-   r.   r/   r   strr   r   r
   r   r0   r(   r1   r2   s   @r   r4   r4   j   s    ,\ HI  $"&/3 *.  }	
 3- +, X&* >B
3H%
3,4UO
3	,	
3 
3r   r4   c                        e Zd ZdZdZ	 	 	 	 ddddedee   dee   dee   d	eee	      d
ee
   f fdZe	 ddee
   ded   ded    f fd       Z xZS )r   a	  
    This object contains information about a user that was shared with the bot using a
    :class:`telegram.KeyboardButtonRequestUsers` button.

    Objects of this class are comparable in terms of equality. Two objects of this class are
    considered equal, if their :attr:`user_id` is equal.

    .. versionadded:: 21.1

    Args:
        user_id (:obj:`int`): Identifier of the shared user. This number may have 32 significant
            bits and some programming languages may have difficulty/silent defects in interpreting
            it. But it has atmost 52 significant bits, so 64-bit integers or double-precision
            float types are safe for storing these identifiers. The bot may not have access to the
            user and could be unable to use this identifier, unless the user is already known to
            the bot by some other means.
        first_name (:obj:`str`, optional): First name of the user, if the name was requested by the
            bot.
        last_name (:obj:`str`, optional): Last name of the user, if the name was requested by the
            bot.
        username (:obj:`str`, optional): Username of the user, if the username was requested by the
            bot.
        photo (Sequence[:class:`telegram.PhotoSize`], optional): Available sizes of the chat photo,
            if the photo was requested by the bot.

    Attributes:
        user_id (:obj:`int`): Identifier of the shared user. This number may have 32 significant
            bits and some programming languages may have difficulty/silent defects in interpreting
            it. But it has atmost 52 significant bits, so 64-bit integers or double-precision
            float types are safe for storing these identifiers. The bot may not have access to the
            user and could be unable to use this identifier, unless the user is already known to
            the bot by some other means.
        first_name (:obj:`str`): Optional. First name of the user, if the name was requested by the
            bot.
        last_name (:obj:`str`): Optional. Last name of the user, if the name was requested by the
            bot.
        username (:obj:`str`): Optional. Username of the user, if the username was requested by the
            bot.
        photo (Tuple[:class:`telegram.PhotoSize`]): Available sizes of the chat photo, if
            the photo was requested by the bot. This list is empty if the photo was not requsted.
    )
first_name	last_namer6   user_idr8   Nr   rD   rB   rC   r8   r6   r   c                    t         |   |       || _        || _        || _        || _        t        |      | _        | j                  f| _        | j                          y r   )
r   r   rD   rB   rC   r8   r	   r6   r   r   )r   rD   rB   rC   r8   r6   r   r   s          r   r   zSharedUser.__init__   sS     	J/#)3(1'/6H6O
,,r   r   r   r   r   c                     | j                  |      }|syt        j                  |j                  d      |      |d<   t        |   ||      S r;   r<   r=   s      r   r(   zSharedUser.de_json   r>   r   )NNNNr)   r?   r2   s   @r   r   r      s    (T LI
 %)#'"&/3 *. SM C=	
 3- +, X&* >B
3H%
3,4UO
3	,	
3 
3r   r   N)r-   typingr   r   r   r   telegram._files.photosizer   telegram._telegramobjectr   telegram._utils.argumentparsingr	   telegram._utils.typesr
   telegram._botr   r   r4   r    r   r   <module>rN      sQ   & V ; ; / 3 > *!HK. HKVQ3 Q3hM3 M3r   