sign_up()

async 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).

  • no_joined_notifications (bool, optional) – If set to True, users on Telegram that have already added phone_number to their contacts will not receive signup notifications about this user. Defaults to False (or the value configured in Client).

Returns:

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

Raises:

BadRequest – In case the arguments are invalid.