hopefully final fix for antialt, fixed leftover logs from xpsettings

This commit is contained in:
Toastie 2025-03-14 18:01:38 +13:00
parent f2820c980e
commit 775d77e94e
Signed by: toastie_t0ast
GPG key ID: 0861BE54AD481DC7
3 changed files with 4 additions and 10 deletions
src/EllieBot
Db/Models/anti
Modules
Administration/Protection
Xp

View file

@ -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; }

View file

@ -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);

View file

@ -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,