Exemplo n.º 1
0
        public async Task PostAvastarData(int id, string opt = "", string max = "")
        {
            var embed = await GenerateAvastarEmbed(id, Context.Channel.Id, opt, max);

            //embed.WithDescription($"Score : {metadataJson["attributes"][5]["value"]}\nTrait disparity : {disp[0]} <:iconCommon:723497539571154964> {disp[1]} <:iconUncommon:723497171395018762>   {disp[2]} <:iconRare:723497171919306813>   {disp[3]} <:iconEpic:723497171957317782>   {disp[4]} <:iconLegendary:723497171147685961>");
            if (id < 200)
            {
                await ReplyAsync(embed : embed.Build());

                return;
            }
            var input       = "";
            var avaUbObject = await AvaUBObject.GetAvaUbObjectById(id);

            if (avaUbObject.ub2List != null && avaUbObject.ub2List.Count > 0)
            {
                input += $"- Unique-By-2 combos : {avaUbObject.ub2List.Count}\n";
            }
            if (avaUbObject.ub3List != null && avaUbObject.ub3List.Count > 0)
            {
                input += $"- Unique-By-3 combos : {avaUbObject.ub3List.Count}\n";
            }
            if (input.Length == 0)
            {
                input = "None";
            }
            embed.AddField("Unique-By's", input);
            await ReplyAsync(embed : embed.Build());
        }
Exemplo n.º 2
0
        public async Task GetRarestByUb(string ub)
        {
            if (ub.ToLower() != "ub2" && ub.ToLower() != "ub3")
            {
                return;
            }
            var waitEmbed = new EmbedBuilder().WithColor(Color.DarkMagenta).WithTitle("Fetching data <a:loading:726356725648719894>");
            var msg       = await ReplyAsync(embed : waitEmbed.Build());

            var list = await AvaUBObject.GetAvaUbList();

            foreach (var obj in list)
            {
                if (obj.ub2List == null)
                {
                    obj.ub2List = new List <string>();
                }
                if (obj.ub3List == null)
                {
                    obj.ub3List = new List <string>();
                }
            }
            if (ub.ToLower() == "ub2")
            {
                list = list.OrderByDescending(a => a.ub2List.Count).ToList();
            }
            else if (ub.ToLower() == "ub3")
            {
                list = list.OrderByDescending(a => a.ub3List.Count).ToList();
            }
            var embed = new EmbedBuilder().WithColor(Color.DarkMagenta);

            embed.WithTitle($"Top 10 Unique-By-{ub[2]}");
            var str = "";

            for (int i = 0; i < 10; i++)
            {
                str += $"{i + 1}. [Avastar #{list[i].id}]({"https://avastars.io/avastar/"}{list[i].id}) - {(ub.ToLower() == "ub2" ? list[i].ub2List.Count : list[i].ub3List.Count)} {ub.ToUpper()}s\n";
            }
            embed.WithDescription(str);
            await msg.ModifyAsync(m => m.Embed = embed.Build());
        }