contacts.getTopPeers
Get most used peers
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.contacts.getTopPeers({
correspondents: true,
botsPm: true,
botsInline: true,
phoneCalls: true,
forwardUsers: true,
forwardChats: true,
groups: true,
channels: true,
offset: 5972771,
limit: 6658168,
hash: 1575713,
}));
console.log(result); // prints the result
})();TL schema
Parameters
Name
Type
Description
Result
Possible errors
Code
Type
Description
400
TYPES_EMPTY
No top peer type was provided
Can bots use this methd ?
yes
Related pages
How to fetch results from large lists of objects.
Last updated
Was this helpful?