contacts.getTopPeers #

Get most used peers

Layer 223

contacts.topPeersNotModified#de266ef5 = contacts.TopPeers;
contacts.topPeers#70b772a8 categories:Vector<TopPeerCategoryPeers> chats:Vector<Chat> users:Vector<User> = contacts.TopPeers;
contacts.topPeersDisabled#b52c939d = contacts.TopPeers;
---functions---
contacts.getTopPeers#973478b6 flags:# correspondents:flags.0?true bots_pm:flags.1?true bots_inline:flags.2?true phone_calls:flags.3?true forward_users:flags.4?true forward_chats:flags.5?true groups:flags.10?true channels:flags.15?true bots_app:flags.16?true offset:int limit:int hash:long = contacts.TopPeers;

Parameters #

NameTypeDescription
flags#Flags, see TL conditional fields
correspondentsflags.0?trueUsers we've chatted most frequently with
bots_pmflags.1?trueMost used bots
bots_inlineflags.2?trueMost used inline bots
phone_callsflags.3?trueMost frequently called users
forward_usersflags.4?trueUsers to which the users often forwards messages to
forward_chatsflags.5?trueChats to which the users often forwards messages to
groupsflags.10?trueOften-opened groups and supergroups
channelsflags.15?trueMost frequently visited channels
bots_appflags.16?trueMost frequently used Main Mini Bot Apps.
bots_guestchatflags.17?trueMost frequently used guest bots »
offsetintOffset for pagination
limitintMaximum number of results to return, see pagination
hashlongHash used for caching, for more info click here

Result #

contacts.TopPeers

Only users can use this method #

Possible errors #

CodeTypeDescription
400TYPES_EMPTYNo top peer type was provided.

Mini Apps on Telegram #

Bots can offer users interactive HTML5 web apps to completely replace any website.

Guest mode for bots #

Guest bots can be queried by username from any non-secret private chat, group and supergroup (except for groups/supergroups with content protection » enabled), posting their results directly into the chat, even if they're not a member.

Pagination in the API #

How to fetch results from large lists of objects.