From 775d77e94eae49e5a016ee11c86bc3034ccb3994 Mon Sep 17 00:00:00 2001 From: Toastie <toastie@toastiet0ast.com> Date: Fri, 14 Mar 2025 18:01:38 +1300 Subject: [PATCH] hopefully final fix for antialt, fixed leftover logs from xpsettings --- src/EllieBot/Db/Models/anti/AntiAltSetting.cs | 1 - .../Administration/Protection/ProtectionService.cs | 8 ++++---- src/EllieBot/Modules/Xp/XpService.cs | 5 ----- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/EllieBot/Db/Models/anti/AntiAltSetting.cs b/src/EllieBot/Db/Models/anti/AntiAltSetting.cs index a54e495..1a5f051 100644 --- a/src/EllieBot/Db/Models/anti/AntiAltSetting.cs +++ b/src/EllieBot/Db/Models/anti/AntiAltSetting.cs @@ -16,7 +16,6 @@ public class AntiAltSetting public ulong GuildId { get; set; } - [LinqToDB.Mapping.DataType(DataType.Interval)] public TimeSpan MinAge { get; set; } public PunishmentAction Action { get; set; } public int ActionDurationMinutes { get; set; } diff --git a/src/EllieBot/Modules/Administration/Protection/ProtectionService.cs b/src/EllieBot/Modules/Administration/Protection/ProtectionService.cs index 6f0f669..938ca9a 100644 --- a/src/EllieBot/Modules/Administration/Protection/ProtectionService.cs +++ b/src/EllieBot/Modules/Administration/Protection/ProtectionService.cs @@ -502,10 +502,10 @@ public class ProtectionService : IReadyExecutor, IEService { await using var uow = _db.GetDbContext(); - var configs = await uow.GetTable<AntiAltSetting>() - .AsNoTracking() - .Where(x => Queries.GuildOnShard(x.GuildId, _shardData.TotalShards, _shardData.ShardId)) - .ToListAsyncLinqToDB(); + var gids = _client.GetGuildIds(); + var configs = await uow.Set<AntiAltSetting>() + .Where(x => gids.Contains(x.GuildId)) + .ToListAsyncEF(); foreach (var config in configs) _antiAltGuilds[config.GuildId] = new(config); diff --git a/src/EllieBot/Modules/Xp/XpService.cs b/src/EllieBot/Modules/Xp/XpService.cs index 431f92c..b1ba3d2 100644 --- a/src/EllieBot/Modules/Xp/XpService.cs +++ b/src/EllieBot/Modules/Xp/XpService.cs @@ -227,11 +227,6 @@ public class XpService : IEService, IReadyExecutor, IExecNoCommand var oldStats = new LevelStats(u.Xp - data.Xp); var newStats = new LevelStats(u.Xp); - Log.Information("User {User} xp updated from {OldLevel} to {NewLevel}", - u.UserId, - oldStats.TotalXp, - newStats.TotalXp); - if (oldStats.Level < newStats.Level) { await _levelUpQueue.EnqueueAsync(NotifyUser(u.GuildId,