TLSharp/TeleSharp.TL/TL/Messages/TLRequestSetInlineGameScore.cs

49 lines
1.4 KiB
C#
Raw Normal View History

2016-10-13 19:33:16 +02:00
using System.IO;
2017-04-13 08:38:01 +02:00
2016-10-13 19:33:16 +02:00
namespace TeleSharp.TL.Messages
{
2017-04-13 08:38:01 +02:00
[TLObject(363700068)]
2016-10-13 19:33:16 +02:00
public class TLRequestSetInlineGameScore : TLMethod
{
2017-04-13 08:38:01 +02:00
public override int Constructor => 363700068;
2016-10-13 19:33:16 +02:00
2017-04-13 08:38:01 +02:00
public int flags { get; set; }
public bool edit_message { get; set; }
public TLInputBotInlineMessageID id { get; set; }
public TLAbsInputUser user_id { get; set; }
public int score { get; set; }
public bool Response { get; set; }
2016-10-13 19:33:16 +02:00
2017-04-13 08:38:01 +02:00
public void ComputeFlags()
{
flags = 0;
flags = edit_message ? flags | 1 : flags & ~1;
}
2016-10-13 19:33:16 +02:00
public override void DeserializeBody(BinaryReader br)
{
flags = br.ReadInt32();
2017-04-13 08:38:01 +02:00
edit_message = (flags & 1) != 0;
id = (TLInputBotInlineMessageID) ObjectUtils.DeserializeObject(br);
user_id = (TLAbsInputUser) ObjectUtils.DeserializeObject(br);
score = br.ReadInt32();
2016-10-13 19:33:16 +02:00
}
public override void SerializeBody(BinaryWriter bw)
{
2017-04-13 08:38:01 +02:00
bw.Write(Constructor);
2016-10-13 19:33:16 +02:00
ComputeFlags();
2017-04-13 08:38:01 +02:00
bw.Write(flags);
2016-10-13 19:33:16 +02:00
2017-04-13 08:38:01 +02:00
ObjectUtils.SerializeObject(id, bw);
ObjectUtils.SerializeObject(user_id, bw);
bw.Write(score);
2016-10-13 19:33:16 +02:00
}
2017-04-13 08:38:01 +02:00
public override void deserializeResponse(BinaryReader br)
{
Response = BoolUtil.Deserialize(br);
}
2016-10-13 19:33:16 +02:00
}
2017-04-13 08:38:01 +02:00
}