mirror of
https://github.com/sochix/TLSharp.git
synced 2026-04-06 23:15:16 +00:00
Add by userName
This commit is contained in:
parent
1dce594e43
commit
c77cfc064d
4 changed files with 31 additions and 5 deletions
|
|
@ -7,6 +7,7 @@ namespace TLSharp.Core.Requests
|
|||
public class ImportByUserName : MTProtoRequest
|
||||
{
|
||||
private readonly string _userName;
|
||||
public int id { get; private set; }
|
||||
public ImportByUserName(string userName)
|
||||
{
|
||||
_userName = userName;
|
||||
|
|
@ -14,14 +15,14 @@ namespace TLSharp.Core.Requests
|
|||
|
||||
public override void OnSend(BinaryWriter writer)
|
||||
{
|
||||
writer.Write(0xf93ccba3);
|
||||
writer.Write(0xBF0131C);
|
||||
Serializers.String.write(writer, _userName);
|
||||
}
|
||||
|
||||
public override void OnResponse(BinaryReader reader)
|
||||
{
|
||||
var code = reader.ReadUInt32();
|
||||
var peer = TL.Parse<Peer>(reader);
|
||||
id = reader.ReadInt32();
|
||||
}
|
||||
|
||||
public override void OnException(Exception exception)
|
||||
|
|
@ -29,7 +30,7 @@ namespace TLSharp.Core.Requests
|
|||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override bool Confirmed { get; }
|
||||
public override bool Confirmed => true;
|
||||
public override bool Responded { get; }
|
||||
}
|
||||
}
|
||||
|
|
@ -216,7 +216,7 @@ namespace TLSharp.Core
|
|||
await _sender.Send(request);
|
||||
await _sender.Recieve(request);
|
||||
|
||||
return null;
|
||||
return request.id;
|
||||
}
|
||||
|
||||
public async Task SendMessage(int id, string message)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue