aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/cc/woverflow/chatting/chat/ChatSpamBlock.kt
diff options
context:
space:
mode:
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")