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

namespace MyTelegram.Schema;

///<summary>
/// <a href="https://corefork.telegram.org/api/dice">Dice-based animated sticker</a>
/// See <a href="https://corefork.telegram.org/constructor/messageMediaDice" />
///</summary>
[TlObject(0x3f7ee58b)]
public sealed class TMessageMediaDice : IMessageMedia
{
    public uint ConstructorId => 0x3f7ee58b;
    ///<summary>
    /// <a href="https://corefork.telegram.org/api/dice">Dice value</a>
    ///</summary>
    public int Value { get; set; }

    ///<summary>
    /// The emoji, for now <img class="emoji" src="//telegram.org/img/emoji/40/F09F8F80.png" width="20" height="20" alt="🏀">, <img class="emoji" src="//telegram.org/img/emoji/40/F09F8EB2.png" width="20" height="20" alt="🎲"> and <img class="emoji" src="//telegram.org/img/emoji/40/F09F8EAF.png" width="20" height="20" alt="🎯"> are supported
    ///</summary>
    public string Emoticon { get; set; }

    public void ComputeFlag()
    {

    }

    public void Serialize(IBufferWriter<byte> writer)
    {
        ComputeFlag();
        writer.Write(ConstructorId);
        writer.Write(Value);
        writer.Write(Emoticon);
    }

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Value = buffer.ReadInt32();
        Emoticon = buffer.ReadString();
    }
}