change: Leaderboards will show 10 users per page

This commit is contained in:
Kwoth
2024-10-07 09:07:32 +00:00
parent 1340533c21
commit cd8c14c607
7 changed files with 33 additions and 47 deletions

View File

@@ -107,7 +107,7 @@ public partial class Xp : NadekoModule<XpService>
[Cmd]
[UserPerm(GuildPerm.ManageChannels)]
[RequireContext(ContextType.Guild)]
public async Task XpExclude(Channel _, [Leftover] IChannel channel = null)
public async Task XpExclude(Channel _, [Leftover] IChannel? channel = null)
{
if (channel is null)
channel = ctx.Channel;
@@ -203,7 +203,7 @@ public partial class Xp : NadekoModule<XpService>
await Response()
.Paginated()
.PageItems(GetPageItems)
.PageSize(9)
.PageSize(10)
.CurrentPage(page)
.Page((users, curPage) =>
{
@@ -262,7 +262,7 @@ public partial class Xp : NadekoModule<XpService>
await Response()
.Paginated()
.PageItems(GetPageItems)
.PageSize(9)
.PageSize(10)
.Page((users, curPage) =>
{
var embed = _sender.CreateEmbed()

View File

@@ -571,8 +571,8 @@ public class XpService : INService, IReadyExecutor, IExecNoCommand
.UserXpStats
.Where(x => x.GuildId == guildId)
.OrderByDescending(x => x.Xp + x.AwardedXp)
.Skip(page * 9)
.Take(9)
.Skip(page * 10)
.Take(10)
.ToArrayAsyncLinqToDB();
}
@@ -582,8 +582,8 @@ public class XpService : INService, IReadyExecutor, IExecNoCommand
return await uow.Set<UserXpStats>()
.Where(x => x.GuildId == guildId && x.UserId.In(users))
.OrderByDescending(x => x.Xp + x.AwardedXp)
.Skip(page * 9)
.Take(9)
.Skip(page * 10)
.Take(10)
.ToArrayAsyncLinqToDB();
}
@@ -593,8 +593,8 @@ public class XpService : INService, IReadyExecutor, IExecNoCommand
return await uow.GetTable<DiscordUser>()
.OrderByDescending(x => x.TotalXp)
.Skip(page * 9)
.Take(9)
.Skip(page * 10)
.Take(10)
.ToArrayAsyncLinqToDB();
}
@@ -605,8 +605,8 @@ public class XpService : INService, IReadyExecutor, IExecNoCommand
return await uow.GetTable<DiscordUser>()
.Where(x => x.UserId.In(users))
.OrderByDescending(x => x.TotalXp)
.Skip(page * 9)
.Take(9)
.Skip(page * 10)
.Take(10)
.ToArrayAsyncLinqToDB();
}