mirror of
https://github.com/sochix/TLSharp.git
synced 2026-04-20 22:05:10 +00:00
TelegramClient.ResolveUsernameAsync
This commit is contained in:
parent
bca8bc5631
commit
900ed3a705
1 changed files with 11 additions and 0 deletions
|
|
@ -300,6 +300,17 @@ namespace TLSharp.Core
|
||||||
.ConfigureAwait(false);
|
.ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<TLResolvedPeer> ResolveUsernameAsync(string usernameToResolve, CancellationToken token = default(CancellationToken))
|
||||||
|
{
|
||||||
|
if (usernameToResolve.StartsWith("@"))
|
||||||
|
usernameToResolve = usernameToResolve.Substring(1);
|
||||||
|
|
||||||
|
var req = new TLRequestResolveUsername() { Username = usernameToResolve };
|
||||||
|
|
||||||
|
return await SendAuthenticatedRequestAsync<TLResolvedPeer>(req, token)
|
||||||
|
.ConfigureAwait(false);
|
||||||
|
}
|
||||||
|
|
||||||
public async Task<TLImportedContacts> ImportContactsAsync(IReadOnlyList<TLInputPhoneContact> contacts, CancellationToken token = default(CancellationToken))
|
public async Task<TLImportedContacts> ImportContactsAsync(IReadOnlyList<TLInputPhoneContact> contacts, CancellationToken token = default(CancellationToken))
|
||||||
{
|
{
|
||||||
var req = new TLRequestImportContacts { Contacts = new TLVector<TLInputPhoneContact>(contacts)};
|
var req = new TLRequestImportContacts { Contacts = new TLVector<TLInputPhoneContact>(contacts)};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue