From 685c94bd0113df701c860f104914ac3381629b1f Mon Sep 17 00:00:00 2001 From: Anand S <36130650+ClobberXD@users.noreply.github.com> Date: Thu, 19 Apr 2018 20:01:55 +0530 Subject: [PATCH] Removes *all* white-spaces from message this to ensure players can't get around this mod by adding spaces between words (e.g. "f uck") --- init.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 51fe8f9..a39654d 100644 --- a/init.lua +++ b/init.lua @@ -62,8 +62,9 @@ function filter.register_on_violation(func) end function filter.check_message(name, message) + local trimmed_msg = message:gsub(" ","") for _, w in ipairs(words) do - if string.find(message:lower(), "%f[%a]" .. w .. "%f[%A]") then + if string.find(trimmed_msg:lower(), "%f[%a]" .. w .. "%f[%A]") then return false end end