Compare commits
5 Commits
master
...
lower_case
Author | SHA1 | Date | |
---|---|---|---|
|
3dd2c91bdc | ||
f9492100a4 | |||
|
00c7af74f9 | ||
|
ea579e8a59 | ||
|
204550756b |
5
init.lua
5
init.lua
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user