auth.bindTempAuthKey

Binds a temporary authorization key temp_auth_key_id to the permanent authorization key perm_auth_key_id. Each permanent key may only be bound to one temporary key at a time, binding a new temporary key overwrites the previous one.

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.bindTempAuthKey({
        permAuthKeyId: 4315316,
        nonce: 281486,
        expiresAt: 5653333,
        encryptedMessage: Buffer.from('some bytes here'),
        }));
    console.log(result); // prints the result
})();

TL schema

temp_auth_key_id

Parameters

Name

Type

Description

perm_auth_key_id

Permanent auth_key_id to bind to

nonce

Random long from Binding message contents

expires_at

Unix timestamp to invalidate temporary key, see Binding message contents

encrypted_message

Result

Bool

Possible errors

Code

Type

Description

Can bots use this methd ?

yes

Binding temporary authorization key to permanent ones.

A basic bare type, elements of which correspond to two-element sequences, representing 64-bit signed numbers (little-endian).

A basic bare type, the values of which correspond to single-element sequences, i.e. numbers from -2^31 to 2^31-1 which in this case represent themselves.

Additional options for calling methods.

Additional options for calling methods.

Initialize connection

Last updated