fixed .sfl and related commands' toggles

This commit is contained in:
Toastie 2025-03-16 15:31:29 +13:00
parent 7b4d4b1f8c
commit 77628be826
Signed by: toastie_t0ast
GPG key ID: 0861BE54AD481DC7

View file

@ -255,8 +255,8 @@ public sealed class FilterService : IExecOnMessage, IReadyExecutor
{
FilterInvitesChannels = conf?.FilterInvitesChannelIds.Select(x => x.ChannelId).ToArray() ?? [],
FilterLinksChannels = conf?.FilterLinksChannelIds.Select(x => x.ChannelId).ToArray() ?? [],
FilterInvitesEnabled = false,
FilterLinksEnabled = false,
FilterInvitesEnabled = conf?.FilterInvites ?? InviteFilteringServers.Contains(guildId),
FilterLinksEnabled = conf?.FilterLinks ?? InviteFilteringServers.Contains(guildId),
};
}
@ -271,6 +271,7 @@ public sealed class FilterService : IExecOnMessage, IReadyExecutor
}
else
{
LinkFilteringServers.TryRemove(guildId);
fc.FilterLinks = false;
}
@ -313,6 +314,7 @@ public sealed class FilterService : IExecOnMessage, IReadyExecutor
return true;
}
InviteFilteringServers.TryRemove(guildId);
fc.FilterInvites = false;
await uow.SaveChangesAsync();
return false;
@ -352,6 +354,7 @@ public sealed class FilterService : IExecOnMessage, IReadyExecutor
return true;
}
WordFilteringServers.TryRemove(guildId);
fc.FilterWords = false;
await uow.SaveChangesAsync();
return false;