SignUpRequest

Only users can use this request. See code examples.

---functions---
auth.signUp#aac7b717 flags:# no_joined_notifications:flags.0?true phone_number:string phone_code_hash:string first_name:string last_name:string = auth.Authorization

Returns

auth.Authorization

This type can be an instance of either:

AuthorizationAuthorizationSignUpRequired

Parameters

phone_numberstring
phone_code_hashstring
first_namestring
last_namestring
no_joined_notificationsflagThis argument defaults to None and can be omitted.

Known RPC errors

This request can cause 9 known errors:

FirstNameInvalidErrorThe first name is invalid.
MemberOccupyPrimaryLocFailedErrorOccupation of primary member location failed.
PhoneCodeEmptyErrorThe phone code is missing.
PhoneCodeExpiredErrorThe confirmation code has expired.
PhoneCodeInvalidErrorThe phone code entered was invalid.
PhoneNumberFloodErrorYou asked for the code too many times..
PhoneNumberInvalidErrorThe phone number is invalid.
PhoneNumberOccupiedErrorThe phone number is already in use.
RegIdGenerateFailedErrorFailure while generating registration ID.

You can import these from telethon.errors.

Example

from telethon.sync import TelegramClient
from telethon import functions, types

with TelegramClient(name, api_id, api_hash) as client:
    result = client(functions.auth.SignUpRequest(
        phone_number='some string here',
        phone_code_hash='some string here',
        first_name='some string here',
        last_name='some string here',
        no_joined_notifications=True
    ))
    print(result.stringify())