o
    ZzjH8  ã                   @   s„   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	„ d	eƒ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)ÚChatAdministratorRights)ÚTelegramObject)Úde_json_optional)ÚJSONDict)ÚBotc                       sv   e Zd ZdZdZ						dddœdededB dedB dedB d	edB d
edB dedB dedB f‡ fdd„Z‡  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          	         sN   t ƒ j|d� || _|| _|| _|| _|| _|| _|| _| 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__© úZ/var/www/kodo/tsheker/venv/lib/python3.10/site-packages/telegram/_keyboardbuttonrequest.pyr   j   s   
z#KeyboardButtonRequestUsers.__init__)NNNNNN)
Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú	__slots__ÚintÚboolr   r   Ú__classcell__r   r   r   r   r       s8    ?ø
öþýüûúùø
ör   c                       s¸   e Zd ZdZdZ									dddœdedededB dedB d	edB d
edB dedB dedB dedB dedB dedB dedB f‡ fdd„Z	e
ddedddd f‡ fdd„ƒZ‡  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)   r,   r%   r&   r+   r   r   r   c                   sf   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   r   r   r   r   r   r   Þ   s   
z"KeyboardButtonRequestChat.__init__ÚdataÚbotz
Bot | NoneÚreturnc                    sF   |   |¡}t| d¡t|ƒ|d< t| d¡t|ƒ|d< tƒ j||d�S )z,See :meth:`telegram.TelegramObject.de_json`.r,   r%   )r-   r.   )Ú_parse_datar   Úgetr   r   Úde_json)Úclsr-   r.   r   r   r   r2     s   
ÿÿz!KeyboardButtonRequestChat.de_json)	NNNNNNNNN)N)r   r   r   r   r    r!   r"   r   r   r   Úclassmethodr2   r#   r   r   r   r   r$   ‡   sR    Hôòþýüûúùø	÷
öõôò$&r$   c                       sN   e Zd ZdZdZ		dddœdededB dedB dedB f‡ fd	d
„Z‡  Z	S )ÚKeyboardButtonRequestManagedBota  
    This object defines the parameters for the creation of a managed bot.
    Information about the created bot will be shared with the bot using the update
    managed_bot and a :obj:`telegram.Message` with the field
    :attr:`telegram.Message.managed_bot_created`.

    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:: 22.8

    Args:
        request_id (:obj:`int`): Signed 32-bit identifier of the request. Must be unique
            within the message.
        suggested_name (:obj:`str`, optional): Suggested name for the bot.
        suggested_username (:obj:`str`, optional): Suggested username for the bot.

    Attributes:
        request_id (:obj:`int`): Signed 32-bit identifier of the request. Must be unique
            within the message.
        suggested_name (:obj:`str`): Optional. Suggested name for the bot.
        suggested_username (:obj:`str`): Optional. Suggested username for the bot.
    )r
   Úsuggested_nameÚsuggested_usernameNr   r
   r6   r7   r   c                   s6   t ƒ j|d� || _|| _|| _| jf| _|  ¡  d S r   )r   r   r
   r6   r7   r   r   )r   r
   r6   r7   r   r   r   r   r   0  s   
z(KeyboardButtonRequestManagedBot.__init__)NN)
r   r   r   r   r    r!   Ústrr   r   r#   r   r   r   r   r5     s     	üúþýüúr5   N)r   Útypingr   Ú!telegram._chatadministratorrightsr   Útelegram._telegramobjectr   Útelegram._utils.argumentparsingr   Útelegram._utils.typesr   Útelegramr   r   r$   r5   r   r   r   r   Ú<module>   s   g 