nullref fixes

This commit is contained in:
Toastie 2025-02-04 00:49:18 +13:00
parent fda37f0e15
commit 3f26f9f8f5
Signed by: toastie_t0ast
GPG key ID: 0861BE54AD481DC7

View file

@ -9,17 +9,17 @@ namespace EllieBot.Modules.Permissions.Services;
public sealed class FilterService : IExecOnMessage, IReadyExecutor
{
public ConcurrentHashSet<ulong> InviteFilteringChannels { get; }
public ConcurrentHashSet<ulong> InviteFilteringServers { get; }
public ConcurrentHashSet<ulong> InviteFilteringChannels { get; } = [];
public ConcurrentHashSet<ulong> InviteFilteringServers { get; } = [];
//serverid, filteredwords
public ConcurrentDictionary<ulong, ConcurrentHashSet<string>> ServerFilteredWords { get; }
public ConcurrentDictionary<ulong, ConcurrentHashSet<string>> ServerFilteredWords { get; } = new();
public ConcurrentHashSet<ulong> WordFilteringChannels { get; }
public ConcurrentHashSet<ulong> WordFilteringServers { get; }
public ConcurrentHashSet<ulong> WordFilteringChannels { get; } = [];
public ConcurrentHashSet<ulong> WordFilteringServers { get; } = [];
public ConcurrentHashSet<ulong> LinkFilteringChannels { get; }
public ConcurrentHashSet<ulong> LinkFilteringServers { get; }
public ConcurrentHashSet<ulong> LinkFilteringChannels { get; } = [];
public ConcurrentHashSet<ulong> LinkFilteringServers { get; } = [];
public int Priority
=> int.MaxValue - 1;
@ -32,15 +32,6 @@ public sealed class FilterService : IExecOnMessage, IReadyExecutor
_db = db;
_shardData = shardData;
using (var uow = db.GetDbContext())
{
var ids = client.GetGuildIds();
var configs = uow.Set<GuildConfig>()
.AsQueryable()
.Where(gc => ids.Contains(gc.GuildId))
.ToList();
}
client.MessageUpdated += (oldData, newMsg, channel) =>
{
_ = Task.Run(() =>