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

namespace MyTelegram.Schema;

///<summary>
/// The <a href="https://corefork.telegram.org/api/bots/commands">command set</a> of a certain bot in a certain chat has changed.
/// See <a href="https://corefork.telegram.org/constructor/updateBotCommands" />
///</summary>
[TlObject(0x4d712f2e)]
public sealed class TUpdateBotCommands : IUpdate
{
    public uint ConstructorId => 0x4d712f2e;
    ///<summary>
    /// The affected chat
    /// See <a href="https://corefork.telegram.org/type/Peer" />
    ///</summary>
    public MyTelegram.Schema.IPeer Peer { get; set; }

    ///<summary>
    /// ID of the bot that changed its command set
    ///</summary>
    public long BotId { get; set; }

    ///<summary>
    /// New bot commands
    ///</summary>
    public TVector<MyTelegram.Schema.IBotCommand> Commands { get; set; }

    public void ComputeFlag()
    {

    }

    public void Serialize(IBufferWriter<byte> writer)
    {
        ComputeFlag();
        writer.Write(ConstructorId);
        writer.Write(Peer);
        writer.Write(BotId);
        writer.Write(Commands);
    }

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Peer = buffer.Read<MyTelegram.Schema.IPeer>();
        BotId = buffer.ReadInt64();
        Commands = buffer.Read<TVector<MyTelegram.Schema.IBotCommand>>();
    }
}