messages.getStatsURL

Returns URL with the chat statistics. Currently this method can be used only for channels

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.messages.getStatsURL({
        dark: true,
        peer: new Api.InputPeer({...}),
        params: 'random string here',
        }));
    console.log(result); // prints the result
})();

TL schema

statsURL#47a971e0 url:string = StatsURL;
---functions---
messages.getStatsURL#812c2ae6 flags:# dark:flags.0?true peer:InputPeer params:string = StatsURL;

Parameters

Name

Type

Description

flags

dark

Pass true if a URL with the dark theme must be returned

peer

Chat identifier

params

Parameters from tg://statsrefresh?params=** link

Result

StatsURL

Possible errors

Code

Type

Description

400

PEER_ID_INVALID

The provided peer id is invalid

Can bots use this methd ?

yes

Last updated