phone.discardCall

Refuse or end running 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.discardCall({
        video: true,
        peer: new Api.InputPhoneCall({...}),
        duration: 789254,
        reason: new Api.PhoneCallDiscardReason({...}),
        connectionId: 2038378,
        }));
    console.log(result); // prints the result
})();

TL schema

Parameters

Name

Type

Description

flags

video

Whether this is a video call

peer

The phone call

duration

Call duration

reason

Why was the call discarded

connection_id

Preferred libtgvoip relay ID

Result

Updates

Possible errors

Code

Type

Description

400

CALL_ALREADY_ACCEPTED

The call was already accepted

400

CALL_PEER_INVALID

The provided call peer object is invalid

Can bots use this methd ?

yes

Last updated

Was this helpful?