summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README2
-rw-r--r--depends.txt1
-rw-r--r--init.lua8
3 files changed, 11 insertions, 0 deletions
diff --git a/README b/README
new file mode 100644
index 0000000..db246f7
--- /dev/null
+++ b/README
@@ -0,0 +1,2 @@
+This is a simple mod for Minetest that kicks players that attempt to send all-caps messages of more than 5 characters.
+It will also send a message to all players stating that the kick occurred, and if the irc mod is installed, the same message will be sent to the IRC channel.
diff --git a/depends.txt b/depends.txt
new file mode 100644
index 0000000..20efb18
--- /dev/null
+++ b/depends.txt
@@ -0,0 +1 @@
+irc?
diff --git a/init.lua b/init.lua
new file mode 100644
index 0000000..421b04d
--- /dev/null
+++ b/init.lua
@@ -0,0 +1,8 @@
+minetest.register_on_chat_message(function(name, message)
+ if message:len()>5 and message:lower()~=message and message:upper()==message then
+ minetest.kick_player(name,"Sending all-caps messages is not allowed")
+ minetest.chat_send_all(string.format("* %s was kicked for sending an all-caps message.",name))
+ if minetest.get_modpath("irc") then irc:say(string.format("* %s was kicked for sending an all-caps message.",name)) end
+ minetest.log("action", string.format("Kicked %s for sending an all-caps message",name))
+ end
+end)