aboutsummaryrefslogtreecommitdiff
path: root/data/builtin.lua
diff options
context:
space:
mode:
Diffstat (limited to 'data/builtin.lua')
-rw-r--r--data/builtin.lua21
1 files changed, 21 insertions, 0 deletions
diff --git a/data/builtin.lua b/data/builtin.lua
index 6fd19404e..b1abeb364 100644
--- a/data/builtin.lua
+++ b/data/builtin.lua
@@ -147,3 +147,24 @@ minetest.register_node("ignore", {
air_equivalent = true,
})
+--
+-- Chat message processing
+--
+
+minetest.registered_on_chat_messages = {}
+
+minetest.on_chat_message = function(name, message)
+ for i,func in ipairs(minetest.registered_on_chat_messages) do
+ ate = func(name, message)
+ if ate then
+ return true
+ end
+ end
+ return false
+end
+
+minetest.register_on_chat_message = function(func)
+ table.insert(minetest.registered_on_chat_messages, func)
+end
+
+-- END