mirror of
https://github.com/sochix/TLSharp.git
synced 2026-04-09 08:25:13 +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; }
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue