From d9785c5476811a798ae5e1f6c996152ea5e27561 Mon Sep 17 00:00:00 2001 From: Gael-de-Sailly Date: Sat, 2 May 2015 16:42:35 +0200 Subject: [PATCH] Add time IRC command --- mods/irc/botcmds.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mods/irc/botcmds.lua b/mods/irc/botcmds.lua index 34978a87..0f74726d 100644 --- a/mods/irc/botcmds.lua +++ b/mods/irc/botcmds.lua @@ -163,3 +163,12 @@ irc:register_bot_command("players", { end }) +irc:register_bot_command("timeofday", { + description = "Tell the in-game time of day", + func = function(user, args) + local timeofday = minetest.get_timeofday() + local hours, minutes = math.modf(timeofday * 24) + minutes = math.floor(minutes * 60) + return true, "It's " .. hours .. " h " .. minutes .. " min." + end +})