auth.signUp

Registers a validated phone number in the system.

Example

const {Api, TelegramClient} = require('telegram');
const {StringSession} = require('telegram/sessions');

const session = new StringSession('');
const client = new TelegramClient(session, apiId, apiHash, {});

(async function run() {
    const result = await client.invoke(new Api.auth.signUp({
        phoneNumber: 'random string here',
        phoneCodeHash: 'random string here',
        firstName: 'random string here',
        lastName: 'random string here',
        }));
    console.log(result); // prints the result
})();

TL schema

auth.authorization#cd050916 flags:# tmp_sessions:flags.0?int user:User = auth.Authorization;
auth.authorizationSignUpRequired#44747e9a flags:# terms_of_service:flags.0?help.TermsOfService = auth.Authorization;
---functions---
auth.signUp#80eee427 phone_number:string phone_code_hash:string first_name:string last_name:string = auth.Authorization;

Parameters

Result

Returns an auth.Authorization object with information about the new authorization.

Possible errors

Can bots use this methd ?

yes

Last updated