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:
Authorization | AuthorizationSignUpRequired |
Parameters
phone_number | string | |
phone_code_hash | string | |
first_name | string | |
last_name | string | |
no_joined_notifications | flag | This argument defaults to None and can be omitted. |
Known RPC errors
This request can cause 9 known errors:
FirstNameInvalidError | The first name is invalid. |
MemberOccupyPrimaryLocFailedError | Occupation of primary member location failed. |
PhoneCodeEmptyError | The phone code is missing. |
PhoneCodeExpiredError | The confirmation code has expired. |
PhoneCodeInvalidError | The phone code entered was invalid. |
PhoneNumberFloodError | You asked for the code too many times.. |
PhoneNumberInvalidError | The phone number is invalid. |
PhoneNumberOccupiedError | The phone number is already in use. |
RegIdGenerateFailedError | Failure 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())