mirror of
https://github.com/sochix/TLSharp.git
synced 2025-12-06 08:02:00 +01:00
Search user by username with send message test. (#356)
* Search user by username with send message test.
This commit is contained in:
parent
218de866cc
commit
0727b29fa3
|
|
@ -371,6 +371,23 @@ namespace TLSharp.Core
|
|||
return await SendRequestAsync<TLFound>(r);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Serch user or chat. API: contacts.search#11f812d8 q:string limit:int = contacts.Found;
|
||||
/// </summary>
|
||||
/// <param name="q">User or chat name</param>
|
||||
/// <param name="limit">Max result count</param>
|
||||
/// <returns></returns>
|
||||
public async Task<TLFound> SearchUserAsync(string q, int limit = 10)
|
||||
{
|
||||
var r = new TeleSharp.TL.Contacts.TLRequestSearch
|
||||
{
|
||||
q = q,
|
||||
limit = limit
|
||||
};
|
||||
|
||||
return await SendRequestAsync<TLFound>(r);
|
||||
}
|
||||
|
||||
private void OnUserAuthenticated(TLUser TLUser)
|
||||
{
|
||||
_session.TLUser = TLUser;
|
||||
|
|
|
|||
Loading…
Reference in a new issue