// <auto-generated/>
// ReSharper disable All

namespace MyTelegram.Schema;

///<summary>
/// Bots only: the number of reactions on a message with anonymous reactions has changed.
/// See <a href="https://corefork.telegram.org/constructor/updateBotMessageReactions" />
///</summary>
[TlObject(0x9cb7759)]
public sealed class TUpdateBotMessageReactions : IUpdate
{
    public uint ConstructorId => 0x9cb7759;
    ///<summary>
    /// Peer of the reacted-to message.
    /// See <a href="https://corefork.telegram.org/type/Peer" />
    ///</summary>
    public MyTelegram.Schema.IPeer Peer { get; set; }

    ///<summary>
    /// ID of the reacted-to message.
    ///</summary>
    public int MsgId { get; set; }

    ///<summary>
    /// Date of the change.
    ///</summary>
    public int Date { get; set; }

    ///<summary>
    /// New reaction counters.
    ///</summary>
    public TVector<MyTelegram.Schema.IReactionCount> Reactions { get; set; }

    ///<summary>
    /// <a href="https://corefork.telegram.org/api/updates">QTS</a> event sequence identifier
    ///</summary>
    public int Qts { get; set; }

    public void ComputeFlag()
    {

    }

    public void Serialize(IBufferWriter<byte> writer)
    {
        ComputeFlag();
        writer.Write(ConstructorId);
        writer.Write(Peer);
        writer.Write(MsgId);
        writer.Write(Date);
        writer.Write(Reactions);
        writer.Write(Qts);
    }

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Peer = buffer.Read<MyTelegram.Schema.IPeer>();
        MsgId = buffer.ReadInt32();
        Date = buffer.ReadInt32();
        Reactions = buffer.Read<TVector<MyTelegram.Schema.IReactionCount>>();
        Qts = buffer.ReadInt32();
    }
}