U
    ddu$                     @   sl   d Z ddlmZmZ ddlmZ ddlmZ ddlm	Z	 erHddl
mZ G dd deZG d	d
 d
eZdS )z8This module contains two objects to request chats/users.    )TYPE_CHECKINGOptional)ChatAdministratorRights)TelegramObject)JSONDict)Botc                       s8   e Zd ZdZdZdddeeeed fddZ  Z	S )	KeyboardButtonRequestUseraQ  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.

    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.

    .. seealso::
        `Telegram Docs on requesting users         <https://core.telegram.org/bots/features#chat-and-user-selection>`_

    .. versionadded:: 20.1

    Args:
        request_id (:obj:`int`): Signed 32-bit identifier of the request, which will be received
            back in the :class:`telegram.UserShared` 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.
    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.
    )
request_iduser_is_botuser_is_premiumN
api_kwargs)r	   r
   r   r   c                   s6   t  j|d || _|| _|| _| jf| _|   d S Nr   )super__init__r	   r
   r   	_id_attrs_freeze)selfr	   r
   r   r   	__class__ C/tmp/pip-unpacked-wheel-e3anp165/telegram/_keyboardbuttonrequest.pyr   B   s    
z"KeyboardButtonRequestUser.__init__)NN)
__name__
__module____qualname____doc__	__slots__intboolr   r   __classcell__r   r   r   r   r      s   	  r   c                       sd   e Zd ZdZdZdddeeeeeeeeed	 fddZ	e
ee ded  d	 fd
dZ  ZS )KeyboardButtonRequestChata  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.

    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.

    .. seealso::
        `Telegram Docs on requesting chats         <https://core.telegram.org/bots/features#chat-and-user-selection>`_

    .. 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.
    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.
    )r	   chat_is_channelchat_is_forumchat_has_usernamechat_is_createduser_administrator_rightsbot_administrator_rightsbot_is_memberNr   )	r	   r!   r"   r#   r$   r%   r&   r'   r   c	          
         sT   t  j|	d || _|| _|| _|| _|| _|| _|| _|| _	| jf| _
|   d S r   )r   r   r	   r!   r"   r#   r$   r%   r&   r'   r   r   )
r   r	   r!   r"   r#   r$   r%   r&   r'   r   r   r   r   r      s    
z"KeyboardButtonRequestChat.__init__r   )databotreturnc                    sN   |  |}|sdS t|d||d< t|d||d< t j||dS )z,See :meth:`telegram.TelegramObject.de_json`.Nr%   r&   )r(   r)   )Z_parse_datar   de_jsongetr   )clsr(   r)   r   r   r   r+      s    
  z!KeyboardButtonRequestChat.de_json)NNNNNN)r   r   r   r   r   r   r   r   r   r   classmethodr   r+   r   r   r   r   r   r    W   s4   9        r    N)r   typingr   r   Z!telegram._chatadministratorrightsr   Ztelegram._telegramobjectr   Ztelegram._utils.typesr   Ztelegramr   r   r    r   r   r   r   <module>   s   9