add: Added unclaimed waifu decay to gambling.yml

fix: Fixed regular decay. It was doing the opposite of what the comment says. All waifu decays will be reset
This commit is contained in:
Kwoth
2024-08-24 23:53:03 +00:00
parent 436f9ed074
commit 67b186a1a5
4 changed files with 137 additions and 98 deletions

View File

@@ -63,6 +63,8 @@ public static class WaifuExtensions
public static async Task<WaifuInfoStats> GetWaifuInfoAsync(this DbContext ctx, ulong userId)
{
await ctx.EnsureUserCreatedAsync(userId);
await ctx.Set<WaifuInfo>()
.ToLinqToDBTable()
.InsertOrUpdateAsync(() => new()
@@ -78,7 +80,8 @@ public static class WaifuExtensions
WaifuId = ctx.Set<DiscordUser>().Where(x => x.UserId == userId).Select(x => x.Id).First()
});
var toReturn = ctx.Set<WaifuInfo>().AsQueryable()
var toReturn = ctx.Set<WaifuInfo>()
.AsQueryable()
.Where(w => w.WaifuId
== ctx.Set<DiscordUser>()
.AsQueryable()