From 978d5791fbebdf244d0923bb08efe38868e7a735 Mon Sep 17 00:00:00 2001 From: louis1706 Date: Fri, 25 Aug 2023 17:01:37 +0200 Subject: [PATCH 1/4] I thinks it's better like this --- BLART/Modules/SpamPrevention.cs | 37 +++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/BLART/Modules/SpamPrevention.cs b/BLART/Modules/SpamPrevention.cs index afedba5..ab2e8bf 100755 --- a/BLART/Modules/SpamPrevention.cs +++ b/BLART/Modules/SpamPrevention.cs @@ -10,7 +10,37 @@ public class SpamPrevention { private static Dictionary SpamTracker { get; } = new(); private static readonly Regex Regex = new(@"^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$", RegexOptions.Compiled | RegexOptions.IgnoreCase); - + private static List BlacklistWebSite = new() + { + "xnxx.com", + "pornhub.com", + "xvideos.com", + "fuq.com", + "xhamster.com", + "tukif.com", + "youporn.com", + "mvideoporno.com", + "qorno.com", + "porn300.com", + "ixxx.com", + "youporngay.com", + "fapvid.com", + "pornoplus.com", + "vidmo.com", + "absoluporn.com", + "its.porn", + "bestgore.com", + "hentaihaven.com" + }; + private static List WhitelistedDiscord = new() + { + "scpsl", // scpsl official + "PyUkWTg", // Exiled official + "dtPGCsm", // DiscoHook official + "csharp", // Csharp official + "p69SGfwxxm", // CedMod by ced777ric + "3j54zBnbbD", // Scripted-Event by Thunder's + }; public static Task OnMessageReceived(SocketMessage arg) => OnMessageReceived(arg, false); public static async Task OnMessageReceived(SocketMessage message, bool skipSpam) @@ -105,12 +135,11 @@ private static bool IsBlockedContent(string url) { url = url.ToLowerInvariant(); - if (url.Contains("pornhub.com") || url.Contains("xvideos.com") || url.Contains("hentaihaven.com") || - url.Contains("redtube.com") || url.Contains("bestgore.com")) + if (BlacklistWebSite.Any(x => BlacklistWebSite.Contains(x))) return true; if (url.Contains("discord.gg")) - if (!url.Contains("scpsl") && !url.Contains("PyUkWTg")) + if (WhitelistedDiscord.Any(x => url.EndsWith(x))) return true; return false; From bd797d7576adab7f771d6af1156cdad7049858c7 Mon Sep 17 00:00:00 2001 From: louis1706 Date: Fri, 25 Aug 2023 17:02:12 +0200 Subject: [PATCH 2/4] Oups :3 --- BLART/Modules/SpamPrevention.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BLART/Modules/SpamPrevention.cs b/BLART/Modules/SpamPrevention.cs index ab2e8bf..933828e 100755 --- a/BLART/Modules/SpamPrevention.cs +++ b/BLART/Modules/SpamPrevention.cs @@ -139,7 +139,7 @@ private static bool IsBlockedContent(string url) return true; if (url.Contains("discord.gg")) - if (WhitelistedDiscord.Any(x => url.EndsWith(x))) + if (!WhitelistedDiscord.Any(x => url.EndsWith(x))) return true; return false; From 9bbee57b67ce89d85976775462c189a517081e94 Mon Sep 17 00:00:00 2001 From: louis1706 Date: Fri, 25 Aug 2023 17:04:25 +0200 Subject: [PATCH 3/4] readonly --- BLART/Modules/SpamPrevention.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BLART/Modules/SpamPrevention.cs b/BLART/Modules/SpamPrevention.cs index 933828e..120d756 100755 --- a/BLART/Modules/SpamPrevention.cs +++ b/BLART/Modules/SpamPrevention.cs @@ -10,7 +10,7 @@ public class SpamPrevention { private static Dictionary SpamTracker { get; } = new(); private static readonly Regex Regex = new(@"^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$", RegexOptions.Compiled | RegexOptions.IgnoreCase); - private static List BlacklistWebSite = new() + private static readonly List BlacklistWebSite = new() { "xnxx.com", "pornhub.com", @@ -32,7 +32,7 @@ public class SpamPrevention "bestgore.com", "hentaihaven.com" }; - private static List WhitelistedDiscord = new() + private static readonly List WhitelistedDiscord = new() { "scpsl", // scpsl official "PyUkWTg", // Exiled official From 5cbcc6ec55e5b9401e5720a6e2d7719f27ef361f Mon Sep 17 00:00:00 2001 From: Yamato <66829532+louis1706@users.noreply.github.com> Date: Fri, 25 Aug 2023 21:16:13 +0200 Subject: [PATCH 4/4] add bit.ly only use by bad guys & whitelist MER --- BLART/Modules/SpamPrevention.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/BLART/Modules/SpamPrevention.cs b/BLART/Modules/SpamPrevention.cs index 120d756..3046639 100755 --- a/BLART/Modules/SpamPrevention.cs +++ b/BLART/Modules/SpamPrevention.cs @@ -31,6 +31,7 @@ public class SpamPrevention "its.porn", "bestgore.com", "hentaihaven.com" + "bit.ly" }; private static readonly List WhitelistedDiscord = new() { @@ -40,6 +41,7 @@ public class SpamPrevention "csharp", // Csharp official "p69SGfwxxm", // CedMod by ced777ric "3j54zBnbbD", // Scripted-Event by Thunder's + "JwAfeSd79u", // MER (MapEditorReborn) by Michal }; public static Task OnMessageReceived(SocketMessage arg) => OnMessageReceived(arg, false); @@ -199,4 +201,4 @@ await Logging.SendLogMessage($"User auto-{(RaidProtection.Check(message.User) ? } } } -} \ No newline at end of file +}