Time to bring these from my personal branch #33

Manually merged
toastie_t0ast merged 57 commits from :v6 into v6 2025-02-28 23:18:40 +00:00
Showing only changes of commit 3f26f9f8f5 - Show all commits

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(() =>