Compare commits

...

5 Commits

View File

@ -28,6 +28,7 @@
local S = minetest.get_translator("filter")
filter = { registered_on_violations = {} }
local utf8 = require 'lua-utf8'
local words = {}
local muted = {}
local violations = {}
@ -65,7 +66,7 @@ end
function filter.check_message(name, message)
for _, w in ipairs(words) do
if string.find(message:lower(), "%f[%a]" .. w .. "%f[%A]") then
if utf8.find(utf8.lower(message), "%f[%a]" .. w .. "%f[%A]") then
return false
end
end
@ -207,7 +208,7 @@ minetest.after(10*60, step)
minetest.register_chatcommand("filter", {
params = S("filter server"),
description = S("manage swear word filter"),
privs = {server = true},
privs = {mute = true},
func = function(name, param)
local cmd, val = param:match("(%w+) (.+)")
if param == "list" then