account.acceptAuthorization

Sends a Telegram Passport authorization form, effectively sharing data with the service

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.account.acceptAuthorization({
        botId: 2982749,
        scope: 'random string here',
        publicKey: 'random string here',
        valueHashes: [new Api.SecureValueHash({...})],
        credentials: new Api.SecureCredentialsEncrypted({...}),
        }));
    console.log(result); // prints the result
})();

TL schema

boolFalse#bc799737 = Bool;
boolTrue#997275b5 = Bool;
---functions---
account.acceptAuthorization#e7027c94 bot_id:int scope:string public_key:string value_hashes:Vector<SecureValueHash> credentials:SecureCredentialsEncrypted = Bool;

Parameters

Name

Type

Description

bot_id

Bot ID

scope

Telegram Passport element types requested by the service

public_key

Service's public key

value_hashes

Types of values sent and their hashes

credentials

Encrypted values

Result

Bool

Possible errors

Code

Type

Description

Can bots use this methd ?

yes

Last updated