From 3db3b8a1cd5262b42bcd8e71df63591cf8efcb12 Mon Sep 17 00:00:00 2001 From: Bella Who Date: Wed, 26 Feb 2020 14:03:00 +0000 Subject: [PATCH] Add hypixel to antispam lol (#489) * hypixel shills * lol Co-authored-by: aUniqueUser <55301516+aUniqueUser@users.noreply.github.com> --- .../kami/module/modules/chat/AntiSpam.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/main/java/me/zeroeightsix/kami/module/modules/chat/AntiSpam.java b/src/main/java/me/zeroeightsix/kami/module/modules/chat/AntiSpam.java index 492adba84..53d3ed8f2 100644 --- a/src/main/java/me/zeroeightsix/kami/module/modules/chat/AntiSpam.java +++ b/src/main/java/me/zeroeightsix/kami/module/modules/chat/AntiSpam.java @@ -17,6 +17,7 @@ import java.util.stream.Collectors; * Created 19 November 2019 by hub * Updated 12 January 2020 by hub * Updated by S-B99 on 18/01/20 + * Updated 19 February 2020 by aUniqueUser */ @Module.Info(name = "AntiSpam", category = Module.Category.CHAT, description = "Removes spam and advertising from the chat", showOnArray = Module.ShowOnArray.OFF) public class AntiSpam extends Module { @@ -28,6 +29,7 @@ public class AntiSpam extends Module { private Setting spammers = register(Settings.b("Spammers", true)); private Setting insulters = register(Settings.b("Insulters", true)); private Setting greeters = register(Settings.b("Greeters", true)); + private Setting hypixelShills = register(Settings.b("Hypixel Shills", true)); private Setting tradeChat = register(Settings.b("Trade Chat", true)); private Setting ips = register(Settings.b("Server Ips", true)); private Setting ipsAgr = register(Settings.b("Ips Aggressive", false)); @@ -151,6 +153,13 @@ public class AntiSpam extends Module { return true; } + if (hypixelShills.getValue() && findPatterns(FilterPatterns.HYPIXEL_SHILLS, message)) { + if (showBlocked.getValue()) { + Command.sendChatMessage("[AntiSpam] Hypixel Shills: "); + } + return true; + } + if (duplicates.getValue()) { if (messageHistory == null) { messageHistory = new ConcurrentHashMap<>(); @@ -296,6 +305,14 @@ public class AntiSpam extends Module { // incomplete }; + private static final String[] HYPIXEL_SHILLS = + { + "/p join", + "/party join", + "road to", + "private games" + }; + private static final String[] DISCORD = { "discord.gg", @@ -346,4 +363,4 @@ public class AntiSpam extends Module { "^To .+: ", }; } -} \ No newline at end of file +}