
    i|1                         d Z ddl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dS )z8This module contains two objects to request chats/users.    )TYPE_CHECKING)ChatAdministratorRights)TelegramObject)de_json_optional)JSONDict)Botc                        e Zd ZdZdZ	 	 	 	 	 	 ddddededz  dedz  dedz  d	edz  d
edz  dedz  dedz  f fdZ xZ	S )KeyboardButtonRequestUsersu  This object defines the criteria used to request a suitable user. The identifier of the
    selected user will be shared with the bot when the corresponding button is pressed. `More
    about requesting users » <https://core.telegram.org/bots/features#chat-and-user-selection>`_.

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

    .. versionadded:: 20.8
        This class was previously named ``KeyboardButtonRequestUser``.

    Args:
        request_id (:obj:`int`): Signed 32-bit identifier of the request, which will be received
            back in the :class:`telegram.UsersShared` object. Must be unique within the message.
        user_is_bot (:obj:`bool`, optional): Pass :obj:`True` to request a bot, pass :obj:`False`
            to request a regular user. If not specified, no additional restrictions are applied.
        user_is_premium (:obj:`bool`, optional): Pass :obj:`True` to request a premium user, pass
            :obj:`False` to request a non-premium user. If not specified, no additional
            restrictions are applied.
        max_quantity (:obj:`int`, optional): The maximum number of users to be selected;
            :tg-const:`telegram.constants.KeyboardButtonRequestUsersLimit.MIN_QUANTITY` -
            :tg-const:`telegram.constants.KeyboardButtonRequestUsersLimit.MAX_QUANTITY`.
            Defaults to :tg-const:`telegram.constants.KeyboardButtonRequestUsersLimit.MIN_QUANTITY`
            .

            .. versionadded:: 20.8
        request_name (:obj:`bool`, optional): Pass :obj:`True` to request the users' first and last
            name.

            .. versionadded:: 21.1
        request_username (:obj:`bool`, optional): Pass :obj:`True` to request the users' username.

            .. versionadded:: 21.1
        request_photo (:obj:`bool`, optional): Pass :obj:`True` to request the users' photo.

            .. versionadded:: 21.1

    Attributes:
        request_id (:obj:`int`): Identifier of the request.
        user_is_bot (:obj:`bool`): Optional. Pass :obj:`True` to request a bot, pass :obj:`False`
            to request a regular user. If not specified, no additional restrictions are applied.
        user_is_premium (:obj:`bool`): Optional. Pass :obj:`True` to request a premium user, pass
            :obj:`False` to request a non-premium user. If not specified, no additional
            restrictions are applied.
        max_quantity (:obj:`int`): Optional. The maximum number of users to be selected;
            :tg-const:`telegram.constants.KeyboardButtonRequestUsersLimit.MIN_QUANTITY` -
            :tg-const:`telegram.constants.KeyboardButtonRequestUsersLimit.MAX_QUANTITY`.
            Defaults to :tg-const:`telegram.constants.KeyboardButtonRequestUsersLimit.MIN_QUANTITY`
            .

            .. versionadded:: 20.8
        request_name (:obj:`bool`): Optional. Pass :obj:`True` to request the users' first and last
            name.

            .. versionadded:: 21.1
        request_username (:obj:`bool`): Optional. Pass :obj:`True` to request the users' username.

            .. versionadded:: 21.1
        request_photo (:obj:`bool`): Optional. Pass :obj:`True` to request the users' photo.

            .. versionadded:: 21.1

    )max_quantity
request_idrequest_namerequest_photorequest_usernameuser_is_botuser_is_premiumN
api_kwargsr   r   r   r   r   r   r   r   c                    t                                          |           || _        || _        || _        || _        || _        || _        || _        | j        f| _	        | 
                                 d S Nr   )super__init__r   r   r   r   r   r   r   	_id_attrs_freeze)
selfr   r   r   r   r   r   r   r   	__class__s
            _/Users/shanyulin/my-agent/.venv/lib/python3.11/site-packages/telegram/_keyboardbuttonrequest.pyr   z#KeyboardButtonRequestUsers.__init__j   sv     	J///) )4,;(4)5-=*7/+    )NNNNNN)
__name__
__module____qualname____doc__	__slots__intboolr   r   __classcell__r   s   @r   r
   r
       s        = =~I $('+#'$((,%) '+   D[ 	
 Dj Tk + d{ tO         r   r
   c                        e Zd ZdZdZ	 	 	 	 	 	 	 	 	 ddddedededz  dedz  d	edz  d
edz  dedz  dedz  dedz  dedz  dedz  dedz  f fdZ	e
ddedddd f fd            Z xZS )KeyboardButtonRequestChatu  This object defines the criteria used to request a suitable chat. The identifier of the
    selected user will be shared with the bot when the corresponding button is pressed. `More
    about requesting users » <https://core.telegram.org/bots/features#chat-and-user-selection>`_.

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

    .. versionadded:: 20.1

    Args:
        request_id (:obj:`int`): Signed 32-bit identifier of the request, which will be received
            back in the :class:`telegram.ChatShared` object. Must be unique within the message.
        chat_is_channel (:obj:`bool`): Pass :obj:`True` to request a channel chat, pass
            :obj:`False` to request a group or a supergroup chat.
        chat_is_forum (:obj:`bool`, optional): Pass :obj:`True` to request a forum supergroup, pass
            :obj:`False` to request a non-forum chat. If not specified, no additional
            restrictions are applied.
        chat_has_username (:obj:`bool`, optional): Pass :obj:`True` to request a supergroup or a
            channel with a username, pass :obj:`False` to request a chat without a username. If
            not specified, no additional restrictions are applied.
        chat_is_created (:obj:`bool`, optional): Pass :obj:`True` to request a chat owned by the
            user. Otherwise, no additional restrictions are applied.
        user_administrator_rights (:class:`ChatAdministratorRights`, optional): Specifies the
            required administrator rights of the user in the chat. If not specified, no additional
            restrictions are applied.
        bot_administrator_rights (:class:`ChatAdministratorRights`, optional): Specifies the
            required administrator rights of the bot in the chat. The rights must be a subset of
            :paramref:`user_administrator_rights`. If not specified, no additional restrictions are
            applied.
        bot_is_member (:obj:`bool`, optional): Pass :obj:`True` to request a chat with the bot
            as a member. Otherwise, no additional restrictions are applied.
        request_title (:obj:`bool`, optional): Pass :obj:`True` to request the chat's title.

            .. versionadded:: 21.1
        request_username (:obj:`bool`, optional): Pass :obj:`True` to request the chat's username.

            .. versionadded:: 21.1
        request_photo (:obj:`bool`, optional): Pass :obj:`True` to request the chat's photo.

            .. versionadded:: 21.1
    Attributes:
        request_id (:obj:`int`): Identifier of the request.
        chat_is_channel (:obj:`bool`): Pass :obj:`True` to request a channel chat, pass
            :obj:`False` to request a group or a supergroup chat.
        chat_is_forum (:obj:`bool`): Optional. Pass :obj:`True` to request a forum supergroup, pass
            :obj:`False` to request a non-forum chat. If not specified, no additional
            restrictions are applied.
        chat_has_username (:obj:`bool`): Optional. Pass :obj:`True` to request a supergroup or a
            channel with a username, pass :obj:`False` to request a chat without a username. If
            not specified, no additional restrictions are applied.
        chat_is_created (:obj:`bool`) Optional. Pass :obj:`True` to request a chat owned by the
            user. Otherwise, no additional restrictions are applied.
        user_administrator_rights (:class:`ChatAdministratorRights`) Optional. Specifies the
            required administrator rights of the user in the chat. If not specified, no additional
            restrictions are applied.
        bot_administrator_rights (:class:`ChatAdministratorRights`) Optional. Specifies the
            required administrator rights of the bot in the chat. The rights must be a subset of
            :attr:`user_administrator_rights`. If not specified, no additional restrictions are
            applied.
        bot_is_member (:obj:`bool`) Optional. Pass :obj:`True` to request a chat with the bot
            as a member. Otherwise, no additional restrictions are applied.
        request_title (:obj:`bool`): Optional. Pass :obj:`True` to request the chat's title.

            .. versionadded:: 21.1
        request_username (:obj:`bool`): Optional. Pass :obj:`True` to request the chat's username.

            .. versionadded:: 21.1
        request_photo (:obj:`bool`): Optional. Pass :obj:`True` to request the chat's photo.

            .. versionadded:: 21.1
    )bot_administrator_rightsbot_is_memberchat_has_usernamechat_is_channelchat_is_createdchat_is_forumr   r   request_titler   user_administrator_rightsNr   r   r,   r.   r+   r-   r0   r)   r*   r/   r   r   r   c                (   t                                          |           || _        || _        || _        || _        || _        || _        || _        || _	        |	| _
        |
| _        || _        | j        f| _        |                                  d S r   )r   r   r   r,   r.   r+   r-   r0   r)   r*   r/   r   r   r   r   )r   r   r,   r.   r+   r-   r0   r)   r*   r/   r   r   r   r   s                r   r   z"KeyboardButtonRequestChat.__init__   s      	J///)%4 +8.?,;Ib&H`%*7*7-=*7/+r   databotz
Bot | Nonereturnc                 $   |                      |          }t          |                    d          t          |          |d<   t          |                    d          t          |          |d<   t	                                          ||          S )z,See :meth:`telegram.TelegramObject.de_json`.r0   r)   )r2   r3   )_parse_datar   getr   r   de_json)clsr2   r3   r   s      r   r8   z!KeyboardButtonRequestChat.de_json  s     t$$,<HH0113JC-
 -
() ,<HH/002I3,
 ,
'( wwDc222r   )	NNNNNNNNN)N)r   r   r    r!   r"   r#   r$   r   r   r   classmethodr8   r%   r&   s   @r   r(   r(      sh       F FPI$ &*)-'+DHCG%)%)(,%)" '+" " "" " d{	"
  $;" " $;T#A" #:D"@" d{" d{" +" d{" tO" " " " " "H 3 38 3, 3B] 3 3 3 3 3 [3 3 3 3 3r   r(   N)r!   typingr   !telegram._chatadministratorrightsr   telegram._telegramobjectr   telegram._utils.argumentparsingr   telegram._utils.typesr   telegramr   r
   r(    r   r   <module>rB      s   & ? >             E E E E E E 3 3 3 3 3 3 < < < < < < * * * * * * d d d d d d d dNG3 G3 G3 G3 G3 G3 G3 G3 G3 G3r   