Skip to main content

contacts.getTopPeers

Get most used peers

func (c *Client) ContactsGetTopPeers(ctx context.Context, request *ContactsGetTopPeersRequest) (ContactsTopPeersClass, error)

Calling this method​

client.Run(ctx, func(ctx context.Context) error {
api := client.API()

res, err := api.ContactsGetTopPeers(ctx, &tg.ContactsGetTopPeersRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // ContactsTopPeersClass
return nil
})

Parameters​

NameTypeRequiredDescription
Correspondentsbool—Users we've chatted most frequently with
BotsPmbool—Most used bots
BotsInlinebool—Most used inline bots
PhoneCallsbool—Most frequently called users
ForwardUsersbool—Users to which the users often forwards messages to
ForwardChatsbool—Chats to which the users often forwards messages to
Groupsbool—Often-opened groups and supergroups
Channelsbool—Most frequently visited channels
BotsAppbool—Most frequently used Main Mini Bot Apps.
BotsGuestchatbool—BotsGuestchat field of ContactsGetTopPeersRequest.
OffsetintyesOffset for pagination
LimitintyesMaximum number of results to return, see pagination
Hashint64yesHash used for caching, for more info click here

Returns​

ContactsTopPeersClass

Possible errors​

CodeTypeDescription
400TYPES_EMPTYNo top peer type was provided.

References​