yl_ticker/chatcommand_say.lua

26 lines
1010 B
Lua

local chatcommand_cmd = "announcement_say"
local chatcommand_definition = {
params = "<announcement ID>",
description = "Say the announcement with ID in main chat." ..
"\nExample: /announcement_say 5",
privs = {[yl_announcements.settings.admin_privs] = true},
func = function(name, param)
local success, message = yl_announcements.chatcommand_announcement_say(
name, param)
if success then
minetest.log("action", "[yl_announcements] player " .. name ..
" sent announcement: " .. param)
return true, message
else
minetest.log("warning",
"[yl_announcements] player " .. name ..
" sent announcement: " .. param ..
" unsuccessfully, message: " .. message)
return false, message
end
end
}
minetest.register_chatcommand(chatcommand_cmd, chatcommand_definition)