예제 #1
0
        public async Task ToastieLeaderboard([Remainder] string str = "")
        {
            var toasties = await BalanceDb.GetAllToasties(Context.Guild.Id);

            var parsed = toasties.Select(x =>
            {
                try
                {
                    return(new UserAmountView()
                    {
                        User = Context.Guild.GetUser(x.Id),
                        Amount = x.Count
                    });
                }
                catch
                { return(null); }
            })
                         .Where(x => x != null && x.User != null);

            var msg = new CustomPaginatedMessage();

            msg.Title = "User Leaderboards";
            var fields = new List <FieldPages>
            {
                new FieldPages
                {
                    Title  = "Toasties <:toastie3:454441133876183060>",
                    Pages  = CustomPaginatedMessage.PagesArray(parsed, 10),
                    Inline = true
                }
            };

            msg.Fields = fields;

            await PagedReplyAsync(msg);
        }