aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/cc/woverflow/chatting/chat/ChatSpamBlock.kt
diff options
context:
space:
mode:
authornextdaydelivery <79922345+nxtdaydelivery@users.noreply.github.com>2022-07-11 13:45:16 +0100
committernextdaydelivery <79922345+nxtdaydelivery@users.noreply.github.com>2022-07-11 13:45:16 +0100
commit89938d618307955ac1218b0f286bb1b1ce252e35 (patch)
treebbab43e037fb75a22c933e8cd80cbe685eff4065 /src/main/kotlin/cc/woverflow/chatting/chat/ChatSpamBlock.kt
parenta0f40b674eb8696e4145aefc960ae0e87173fcb1 (diff)
downloadChatting-89938d618307955ac1218b0f286bb1b1ce252e35.tar.gz
Chatting-89938d618307955ac1218b0f286bb1b1ce252e35.tar.bz2
Chatting-89938d618307955ac1218b0f286bb1b1ce252e35.zip
hippity hoppity oneconfig is my property
Diffstat (limited to 'src/main/kotlin/cc/woverflow/chatting/chat/ChatSpamBlock.kt')
-rw-r--r--src/main/kotlin/cc/woverflow/chatting/chat/ChatSpamBlock.kt4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/kotlin/cc/woverflow/chatting/chat/ChatSpamBlock.kt b/src/main/kotlin/cc/woverflow/chatting/chat/ChatSpamBlock.kt
index 91ea6b5..471eec8 100644
--- a/src/main/kotlin/cc/woverflow/chatting/chat/ChatSpamBlock.kt
+++ b/src/main/kotlin/cc/woverflow/chatting/chat/ChatSpamBlock.kt
@@ -37,7 +37,7 @@ object ChatSpamBlock {
if (!ChattingConfig.customChatFormatting) {
newMessage += rank
}
- newMessage += "$player${EnumChatFormatting.DARK_GRAY.toString()}: $content"
+ newMessage += "$player${EnumChatFormatting.DARK_GRAY}: $content"
event.message = ChatComponentText(newMessage)
}
return
@@ -67,7 +67,7 @@ object ChatSpamBlock {
}
if (message.replace(Regex("[\\w\\s]"), "").length > 2) {
tokens.add("SPECIAL_CHARS")
- } else if (message.replace(Regex("[\\w\\s]"), "").length > 0) {
+ } else if (message.replace(Regex("[\\w\\s]"), "").isNotEmpty()) {
tokens.add("SPECIAL_CHAR")
} else {
tokens.add("LOW_SPECIAL_CHARS")