mirror of
https://github.com/minetest-mods/irc_commands.git
synced 2025-01-09 15:20:19 +01:00
Add timeofday command
This commit is contained in:
parent
22e523cc7a
commit
fd4756e34d
9
init.lua
9
init.lua
@ -133,3 +133,12 @@ irc:register_bot_command("say", {
|
||||
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
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user