$lb is now paginated
This commit is contained in:
@@ -244,19 +244,26 @@ namespace NadekoBot.Modules.Gambling
|
||||
}
|
||||
|
||||
[NadekoCommand, Usage, Description, Aliases]
|
||||
public async Task Leaderboard()
|
||||
public async Task Leaderboard(int page = 1)
|
||||
{
|
||||
List<Currency> richest;
|
||||
using (var uow = DbHandler.UnitOfWork())
|
||||
{
|
||||
richest = uow.Currency.GetTopRichest(9).ToList();
|
||||
richest = uow.Currency.GetTopRichest(9, 9 * (page - 1)).ToList();
|
||||
}
|
||||
if (!richest.Any())
|
||||
return;
|
||||
|
||||
var embed = new EmbedBuilder()
|
||||
.WithOkColor()
|
||||
.WithTitle(NadekoBot.BotConfig.CurrencySign + " " + GetText("leaderboard"));
|
||||
.WithTitle(NadekoBot.BotConfig.CurrencySign +
|
||||
" " + GetText("leaderboard"))
|
||||
.WithFooter(efb => efb.WithText(GetText("page", page)));
|
||||
|
||||
if (!richest.Any())
|
||||
{
|
||||
embed.WithDescription(GetText("no_users_found"));
|
||||
await Context.Channel.EmbedAsync(embed).ConfigureAwait(false);
|
||||
return;
|
||||
}
|
||||
|
||||
for (var i = 0; i < richest.Count; i++)
|
||||
{
|
||||
|
Reference in New Issue
Block a user