More convenience methods for the dashy

This commit is contained in:
Kwoth
2024-04-23 09:12:24 +00:00
parent cc060da1a7
commit c9fb0a8b03
7 changed files with 96 additions and 70 deletions

View File

@@ -751,7 +751,7 @@ public partial class Gambling : GamblingModule<GamblingService>
{
await using (var uow = _db.GetDbContext())
{
cleanRichest = await uow.Set<DiscordUser>().GetTopRichest(_client.CurrentUser.Id, 10_000);
cleanRichest = await uow.Set<DiscordUser>().GetTopRichest(_client.CurrentUser.Id, 0, 10_000);
}
await ctx.Channel.TriggerTypingAsync();
@@ -763,7 +763,7 @@ public partial class Gambling : GamblingModule<GamblingService>
else
{
await using var uow = _db.GetDbContext();
cleanRichest = await uow.Set<DiscordUser>().GetTopRichest(_client.CurrentUser.Id, 9, page);
cleanRichest = await uow.Set<DiscordUser>().GetTopRichest(_client.CurrentUser.Id, page);
}
await ctx.SendPaginatedConfirmAsync(page,
@@ -775,7 +775,7 @@ public partial class Gambling : GamblingModule<GamblingService>
if (!opts.Clean)
{
await using var uow = _db.GetDbContext();
toSend = await uow.Set<DiscordUser>().GetTopRichest(_client.CurrentUser.Id, 9, curPage);
toSend = await uow.Set<DiscordUser>().GetTopRichest(_client.CurrentUser.Id, curPage);
}
else
{

View File

@@ -288,10 +288,10 @@ public class WaifuService : INService, IReadyExecutor
return (oldAff, success, remaining);
}
public IEnumerable<WaifuLbResult> GetTopWaifusAtPage(int page)
public IEnumerable<WaifuLbResult> GetTopWaifusAtPage(int page, int perPage = 9)
{
using var uow = _db.GetDbContext();
return uow.Set<WaifuInfo>().GetTop(9, page * 9);
return uow.Set<WaifuInfo>().GetTop(perPage, page * perPage);
}
public ulong GetWaifuUserId(ulong ownerId, string name)