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
CorrespondentsboolUsers we've chatted most frequently with
BotsPmboolMost used bots
BotsInlineboolMost used inline bots
PhoneCallsboolMost frequently called users
ForwardUsersboolUsers to which the users often forwards messages to
ForwardChatsboolChats to which the users often forwards messages to
GroupsboolOften-opened groups and supergroups
ChannelsboolMost frequently visited channels
BotsAppboolMost frequently used Main Mini Bot Apps.
BotsGuestchatboolBotsGuestchat 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