mirror of
https://github.com/sochix/TLSharp.git
synced 2025-12-06 08:02:00 +01:00
36 lines
756 B
C#
36 lines
756 B
C#
using System;
|
|
using System.IO;
|
|
using TLSharp.Core.MTProto;
|
|
|
|
namespace TLSharp.Core.Requests
|
|
{
|
|
public class ImportByUserName : MTProtoRequest
|
|
{
|
|
private readonly string _userName;
|
|
public int id { get; private set; }
|
|
public ImportByUserName(string userName)
|
|
{
|
|
_userName = userName;
|
|
}
|
|
|
|
public override void OnSend(BinaryWriter writer)
|
|
{
|
|
writer.Write(0xBF0131C);
|
|
Serializers.String.write(writer, _userName);
|
|
}
|
|
|
|
public override void OnResponse(BinaryReader reader)
|
|
{
|
|
var code = reader.ReadUInt32();
|
|
id = reader.ReadInt32();
|
|
}
|
|
|
|
public override void OnException(Exception exception)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public override bool Confirmed => true;
|
|
public override bool Responded { get; }
|
|
}
|
|
} |