nullref fixes
This commit is contained in:
parent
fda37f0e15
commit
3f26f9f8f5
1 changed files with 7 additions and 16 deletions
|
@ -9,17 +9,17 @@ namespace EllieBot.Modules.Permissions.Services;
|
||||||
|
|
||||||
public sealed class FilterService : IExecOnMessage, IReadyExecutor
|
public sealed class FilterService : IExecOnMessage, IReadyExecutor
|
||||||
{
|
{
|
||||||
public ConcurrentHashSet<ulong> InviteFilteringChannels { get; }
|
public ConcurrentHashSet<ulong> InviteFilteringChannels { get; } = [];
|
||||||
public ConcurrentHashSet<ulong> InviteFilteringServers { get; }
|
public ConcurrentHashSet<ulong> InviteFilteringServers { get; } = [];
|
||||||
|
|
||||||
//serverid, filteredwords
|
//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> WordFilteringChannels { get; } = [];
|
||||||
public ConcurrentHashSet<ulong> WordFilteringServers { get; }
|
public ConcurrentHashSet<ulong> WordFilteringServers { get; } = [];
|
||||||
|
|
||||||
public ConcurrentHashSet<ulong> LinkFilteringChannels { get; }
|
public ConcurrentHashSet<ulong> LinkFilteringChannels { get; } = [];
|
||||||
public ConcurrentHashSet<ulong> LinkFilteringServers { get; }
|
public ConcurrentHashSet<ulong> LinkFilteringServers { get; } = [];
|
||||||
|
|
||||||
public int Priority
|
public int Priority
|
||||||
=> int.MaxValue - 1;
|
=> int.MaxValue - 1;
|
||||||
|
@ -32,15 +32,6 @@ public sealed class FilterService : IExecOnMessage, IReadyExecutor
|
||||||
_db = db;
|
_db = db;
|
||||||
_shardData = shardData;
|
_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) =>
|
client.MessageUpdated += (oldData, newMsg, channel) =>
|
||||||
{
|
{
|
||||||
_ = Task.Run(() =>
|
_ = Task.Run(() =>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue