yl_ticker/chatcommand_say.lua
AliasAlreadyTaken a74021b6ce Formatting
2024-05-29 03:14:39 +02:00

27 lines
1.1 KiB
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)
yl_announcements.register_help(chatcommand_cmd, chatcommand_definition)