forked from EllieBotDevs/elliebot
hopefully final fix for antialt, fixed leftover logs from xpsettings
This commit is contained in:
parent
f2820c980e
commit
775d77e94e
3 changed files with 4 additions and 10 deletions
src/EllieBot
|
@ -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; }
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Reference in a new issue