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")
This commit is contained in:
Anand S 2018-04-19 20:01:55 +05:30
parent 99100857af
commit 685c94bd01

View file

@ -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