-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathcontacts.go
35 lines (29 loc) · 818 Bytes
/
contacts.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package mtproto
import "errors"
func (m *MTProto) ContactsGetContacts(hash string) (*TL, error) {
return m.InvokeSync(TL_contacts_getContacts{
Hash: hash,
})
}
func (m *MTProto) ContactsGetTopPeers(correspondents, botsPM, botsInline, groups, channels bool, offset, limit, hash int32) (*TL, error) {
tl, err := m.InvokeSync(TL_contacts_getTopPeers{
Correspondents: correspondents,
Bots_pm: botsPM,
Bots_inline: botsInline,
Groups: groups,
Channels: channels,
Offset: offset,
Limit: limit,
Hash: hash,
})
if err != nil {
return nil, err
}
switch (*tl).(type) {
case TL_contacts_topPeersNotModified:
case TL_contacts_topPeers:
default:
return nil, errors.New("MTProto::ContactsGetTopPeers error: Unknown type")
}
return tl, nil
}