add: Added options '-c' option for '.xpglb' which will show global xp leaderboard only with this server's users

This commit is contained in:
Kwoth
2024-10-04 03:24:18 +00:00
parent 822ce0b8de
commit 3a504a954f
4 changed files with 54 additions and 25 deletions

View File

@@ -87,14 +87,7 @@ public static class DiscordUserExtensions
> users.AsQueryable().Where(y => y.UserId == id).Select(y => y.TotalXp).FirstOrDefault())
.Count()
+ 1;
public static async Task<IReadOnlyCollection<DiscordUser>> GetUsersXpLeaderboardFor(this DbSet<DiscordUser> users, int page, int perPage)
=> await users.ToLinqToDBTable()
.OrderByDescending(x => x.TotalXp)
.Skip(page * perPage)
.Take(perPage)
.ToArrayAsyncLinqToDB();
public static Task<List<DiscordUser>> GetTopRichest(
this DbSet<DiscordUser> users,
ulong botId,