U
    ;g3	                     @   sD   d dl Z d dlZd dlmZ d dlmZ e eZG dd dZdS )    N)raw)typesc                   @   s&   e Zd ZddeeeeddddZdS )	SignUp zpyrogram.Clientz
types.User)selfphone_numberphone_code_hash
first_name	last_namereturnc                    sd   | d}| tjjj||||dI dH }| j|jj	I dH  | j
dI dH  tj| |jS )a  Register a new user in Telegram.

        .. include:: /_includes/usable-by/users.rst

        Parameters:
            phone_number (``str``):
                Phone number in international format (includes the country prefix).

            phone_code_hash (``str``):
                Code identifier taken from the result of :meth:`~pyrogram.Client.send_code`.

            first_name (``str``):
                New user first name.

            last_name (``str``, *optional*):
                New user last name. Defaults to "" (empty string, no last name).

        Returns:
            :obj:`~pyrogram.types.User`: On success, the new registered user is returned.

        Raises:
            BadRequest: In case the arguments are invalid.
        z +)r   r	   r
   r   NF)stripZinvoker   Z	functionsauthr   ZstorageZuser_iduseridZis_botr   ZUser_parse)r   r   r   r	   r
   r r   ]/opt/bot/vods_filmes/script/venv/lib/python3.8/site-packages/pyrogram/methods/auth/sign_up.pysign_up   s    

	zSignUp.sign_upN)r   )__name__
__module____qualname__strr   r   r   r   r   r      s    r   )loggingZpyrogramr   r   	getLoggerr   logr   r   r   r   r   <module>   s
   
