Skip to content

Commit

Permalink
Override /donate command to use swear filter (hopefully done right)
Browse files Browse the repository at this point in the history
  • Loading branch information
src4026 authored Dec 23, 2023
1 parent ad19901 commit e704b64
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions mods/ctf/ctf_chat/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,18 @@ minetest.override_chatcommand("me", {
end
})

minetest.override_chatcommand("donate", {
func = function(name, param)
local old_func = minetest.registered_chatcommands["donate"].func
if filter and not filter.check_message(name, param) then
filter.on_violation(name, param)
return false, "No swearing"
end

return old_func(name, param)
end
})

minetest.register_chatcommand("t", {
params = "msg",
description = "Send a message on the team channel",
Expand Down

0 comments on commit e704b64

Please sign in to comment.