Exemple #1
0
        internal DiscordEmoji(DiscordApiData data)
            : base(data)
        {
            Name          = data.GetString("name");
            UserId        = data.LocateSnowflake("user.id");
            RequireColons = data.GetBoolean("require_colons") ?? false;
            IsManaged     = data.GetBoolean("managed") ?? false;
            IsAnimated    = data.GetBoolean("animated") ?? false;

            IList <DiscordApiData> roles = data.GetArray("roles");

            Snowflake[] roleIds = new Snowflake[roles.Count];

            for (int i = 0; i < roleIds.Length; i++)
            {
                roleIds[i] = (roles[i].ToSnowflake().Value);
            }

            RoleIds = roleIds;
        }