phone.setCallRating

Rate a call

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.phone.setCallRating({
        userInitiative: true,
        peer: new Api.InputPhoneCall({...}),
        rating: 4475374,
        comment: 'random string here',
        }));
    console.log(result); // prints the result
})();

TL schema

Parameters

Name

Type

Description

flags

user_initiative

Whether the user decided on their own initiative to rate the call

peer

The call to rate

rating

Rating in 1-5 stars

comment

An additional comment

Result

Updates with info about the rating message sent to the official VoIP bot

Possible errors

Code

Type

Description

400

CALL_PEER_INVALID

The provided call peer object is invalid

Can bots use this methd ?

yes

Last updated

Was this helpful?