Esempio n. 1
0
        public async Task ListWaifus(int page = 0)
        {
            if (page != 0)
            {
                page -= 1;
            }

            List <Waifus> Ws;

            using (var uow = DBHandler.UnitOfWork())
            {
                Ws = uow.Waifus.GetWaifus(page);
            }

            if (!Ws.Any())
            {
                await Context.Channel.SendErrorAsync($"No Waifus found for page {page + 1}");

                return;
            }

            EmbedBuilder embed = new EmbedBuilder().WithOkColour().WithTitle($"Waifus").WithFooter(efb => efb.WithText($"Page: {page + 1}"));

            string desc = "";

            foreach (Waifus w in Ws)
            {
                desc += $"{w.ID}. {w.Waifu}\n";
            }

            embed.WithDescription(desc);

            await Context.Channel.BlankEmbedAsync(embed);
        }