init.lua 474 B

12345678910111213141516171819202122
  1. if not minetest.global_exists("motd") then motd = {} end
  2. motd.modpath = minetest.get_modpath("motd")
  3. minetest.register_chatcommand("motd", {
  4. params = "",
  5. description = "Show MoTD.",
  6. privs = {},
  7. func = function(name, text)
  8. local motd = minetest.settings:get("motd")
  9. if motd == nil or motd == "" then
  10. minetest.chat_send_player(name, "# Server: MoTD not set.")
  11. return false
  12. end
  13. minetest.chat_send_player(name, "# Server: " .. motd)
  14. return true
  15. end
  16. })