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; }
|
public ulong GuildId { get; set; }
|
||||||
|
|
||||||
[LinqToDB.Mapping.DataType(DataType.Interval)]
|
|
||||||
public TimeSpan MinAge { get; set; }
|
public TimeSpan MinAge { get; set; }
|
||||||
public PunishmentAction Action { get; set; }
|
public PunishmentAction Action { get; set; }
|
||||||
public int ActionDurationMinutes { get; set; }
|
public int ActionDurationMinutes { get; set; }
|
||||||
|
|
|
@ -502,10 +502,10 @@ public class ProtectionService : IReadyExecutor, IEService
|
||||||
{
|
{
|
||||||
await using var uow = _db.GetDbContext();
|
await using var uow = _db.GetDbContext();
|
||||||
|
|
||||||
var configs = await uow.GetTable<AntiAltSetting>()
|
var gids = _client.GetGuildIds();
|
||||||
.AsNoTracking()
|
var configs = await uow.Set<AntiAltSetting>()
|
||||||
.Where(x => Queries.GuildOnShard(x.GuildId, _shardData.TotalShards, _shardData.ShardId))
|
.Where(x => gids.Contains(x.GuildId))
|
||||||
.ToListAsyncLinqToDB();
|
.ToListAsyncEF();
|
||||||
|
|
||||||
foreach (var config in configs)
|
foreach (var config in configs)
|
||||||
_antiAltGuilds[config.GuildId] = new(config);
|
_antiAltGuilds[config.GuildId] = new(config);
|
||||||
|
|
|
@ -227,11 +227,6 @@ public class XpService : IEService, IReadyExecutor, IExecNoCommand
|
||||||
var oldStats = new LevelStats(u.Xp - data.Xp);
|
var oldStats = new LevelStats(u.Xp - data.Xp);
|
||||||
var newStats = new LevelStats(u.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)
|
if (oldStats.Level < newStats.Level)
|
||||||
{
|
{
|
||||||
await _levelUpQueue.EnqueueAsync(NotifyUser(u.GuildId,
|
await _levelUpQueue.EnqueueAsync(NotifyUser(u.GuildId,
|
||||||
|
|
Loading…
Add table
Reference in a new issue