sign_up()

Client.sign_up()

Register a new user in Telegram.

Usable by Users Bots
Parameters:
  • phone_number (str) – Phone number in international format (includes the country prefix).

  • phone_code_hash (str) – Code identifier taken from the result of 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:

User – On success, the new registered user is returned.

Raises:

BadRequest – In case the arguments are invalid.