mirror of
https://github.com/sochix/TLSharp.git
synced 2026-04-05 14:37:04 +00:00
Add contacts.GetContacts method to client
This commit is contained in:
parent
397f20298e
commit
089f80fcce
5 changed files with 107 additions and 75 deletions
|
|
@ -105,8 +105,6 @@ namespace TLSharp.Core
|
|||
request = new AuthSendCodeRequest(phoneNumber, (int)tokenDestination, _apiId, _apiHash, "en");
|
||||
try
|
||||
{
|
||||
|
||||
|
||||
await _sender.Send(request);
|
||||
await _sender.Receive(request);
|
||||
|
||||
|
|
@ -282,5 +280,19 @@ namespace TLSharp.Core
|
|||
|
||||
return regex.IsMatch(number);
|
||||
}
|
||||
|
||||
public async Task<ContactsContacts> GetContacts(IList<int> contactIds = null)
|
||||
{
|
||||
var request = new GetContactsRequest(contactIds);
|
||||
await _sender.Send(request);
|
||||
await _sender.Receive(request);
|
||||
|
||||
return new ContactsContacts
|
||||
{
|
||||
Contacts = request.Contacts,
|
||||
Users = request.Users,
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue