Add /time

This commit is contained in:
2019-01-29 02:57:31 +05:30
parent 0238610cd1
commit 0434bf5854
2 changed files with 9 additions and 3 deletions

View File

@@ -10,6 +10,11 @@ function send_messages(res)
end
http_api.fetch_async({url = "http://localhost:" .. port .. "/sendCode",
post_data = {message = text}})
elseif message == "time" then
local x = minetest.get_timeofday()
local text = string.format("%02d:%02d", math.floor(x*24), math.floor((x*24*60) % 60))
http_api.fetch_async({url = "http://localhost:" .. port .. "/sendCode",
post_data = {message = text}})
else
minetest.chat_send_all(message)
end