mirror of
https://github.com/sochix/TLSharp.git
synced 2026-04-05 14:37:04 +00:00
Search user by username with send message test. (#356)
* Search user by username with send message test.
This commit is contained in:
parent
0428753b2b
commit
47d1c10c9d
4 changed files with 67 additions and 0 deletions
|
|
@ -337,6 +337,23 @@ namespace TLSharp.Core
|
|||
await _sender.SendPingAsync();
|
||||
}
|
||||
|
||||
/// <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…
Add table
Add a link
Reference in a new issue