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
| Name | Type | Required | Description |
|---|---|---|---|
Correspondents | bool | — | Users we've chatted most frequently with |
BotsPm | bool | — | Most used bots |
BotsInline | bool | — | Most used inline bots |
PhoneCalls | bool | — | Most frequently called users |
ForwardUsers | bool | — | Users to which the users often forwards messages to |
ForwardChats | bool | — | Chats to which the users often forwards messages to |
Groups | bool | — | Often-opened groups and supergroups |
Channels | bool | — | Most frequently visited channels |
BotsApp | bool | — | Most frequently used Main Mini Bot Apps. |
BotsGuestchat | bool | — | BotsGuestchat field of ContactsGetTopPeersRequest. |
Offset | int | yes | Offset for pagination |
Limit | int | yes | Maximum number of results to return, see pagination |
Hash | int64 | yes | Hash used for caching, for more info click here |
Returns
Possible errors
| Code | Type | Description |
|---|---|---|
| 400 | TYPES_EMPTY | No top peer type was provided. |
References
- Official documentation
- Generated Go reference
- TL definition:
contacts.getTopPeers#973478b6