2016-09-24 15:38:26 +02:00
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using TeleSharp.TL;
|
|
|
|
|
namespace TeleSharp.TL.Messages
|
|
|
|
|
{
|
2017-07-20 04:07:24 +02:00
|
|
|
[TLObject(-858565059)]
|
2016-09-24 15:38:26 +02:00
|
|
|
public class TLBotResults : TLObject
|
|
|
|
|
{
|
|
|
|
|
public override int Constructor
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
2017-07-20 04:07:24 +02:00
|
|
|
return -858565059;
|
2016-09-24 15:38:26 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-07-20 04:07:24 +02:00
|
|
|
public int flags { get; set; }
|
|
|
|
|
public bool gallery { get; set; }
|
|
|
|
|
public long query_id { get; set; }
|
|
|
|
|
public string next_offset { get; set; }
|
|
|
|
|
public TLInlineBotSwitchPM switch_pm { get; set; }
|
|
|
|
|
public TLVector<TLAbsBotInlineResult> results { get; set; }
|
|
|
|
|
public int cache_time { get; set; }
|
2016-09-24 15:38:26 +02:00
|
|
|
|
|
|
|
|
|
2017-07-20 04:07:24 +02:00
|
|
|
public void ComputeFlags()
|
|
|
|
|
{
|
|
|
|
|
flags = 0;
|
|
|
|
|
flags = gallery ? (flags | 1) : (flags & ~1);
|
|
|
|
|
flags = next_offset != null ? (flags | 2) : (flags & ~2);
|
|
|
|
|
flags = switch_pm != null ? (flags | 4) : (flags & ~4);
|
2016-09-24 15:38:26 +02:00
|
|
|
|
2017-07-20 04:07:24 +02:00
|
|
|
}
|
2016-09-24 15:38:26 +02:00
|
|
|
|
|
|
|
|
public override void DeserializeBody(BinaryReader br)
|
|
|
|
|
{
|
|
|
|
|
flags = br.ReadInt32();
|
2017-07-20 04:07:24 +02:00
|
|
|
gallery = (flags & 1) != 0;
|
|
|
|
|
query_id = br.ReadInt64();
|
|
|
|
|
if ((flags & 2) != 0)
|
|
|
|
|
next_offset = StringUtil.Deserialize(br);
|
|
|
|
|
else
|
|
|
|
|
next_offset = null;
|
2016-09-24 15:38:26 +02:00
|
|
|
|
2017-07-20 04:07:24 +02:00
|
|
|
if ((flags & 4) != 0)
|
|
|
|
|
switch_pm = (TLInlineBotSwitchPM)ObjectUtils.DeserializeObject(br);
|
|
|
|
|
else
|
|
|
|
|
switch_pm = null;
|
2016-09-24 15:38:26 +02:00
|
|
|
|
2017-07-20 04:07:24 +02:00
|
|
|
results = (TLVector<TLAbsBotInlineResult>)ObjectUtils.DeserializeVector<TLAbsBotInlineResult>(br);
|
|
|
|
|
cache_time = br.ReadInt32();
|
2016-09-24 15:38:26 +02:00
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void SerializeBody(BinaryWriter bw)
|
|
|
|
|
{
|
2017-07-20 04:07:24 +02:00
|
|
|
bw.Write(Constructor);
|
2016-09-24 15:38:26 +02:00
|
|
|
ComputeFlags();
|
2017-07-20 04:07:24 +02:00
|
|
|
bw.Write(flags);
|
2016-09-24 15:38:26 +02:00
|
|
|
|
2017-07-20 04:07:24 +02:00
|
|
|
bw.Write(query_id);
|
|
|
|
|
if ((flags & 2) != 0)
|
|
|
|
|
StringUtil.Serialize(next_offset, bw);
|
|
|
|
|
if ((flags & 4) != 0)
|
|
|
|
|
ObjectUtils.SerializeObject(switch_pm, bw);
|
|
|
|
|
ObjectUtils.SerializeObject(results, bw);
|
|
|
|
|
bw.Write(cache_time);
|
2016-09-24 15:38:26 +02:00
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|