generated from your-land/yl_template
25 lines
1.0 KiB
Lua
25 lines
1.0 KiB
Lua
local chatcommand_cmd = "announcement_copy"
|
|
local chatcommand_definition = {
|
|
params = "<announcement ID>", -- Short parameter description
|
|
description = "Open the announcement with ID in a formspec, so it can be copied.", -- Full description
|
|
privs = {[yl_announcements.settings.user_privs] = true},
|
|
func = function(name, param)
|
|
local success, message = yl_announcements.chatcommand_announcement_copy(
|
|
name, param)
|
|
|
|
if success then
|
|
minetest.log("action", "[yl_announcements] player " .. name ..
|
|
" copied announcement: " .. param)
|
|
return true, message
|
|
else
|
|
minetest.log("warning",
|
|
"[yl_announcements] player " .. name ..
|
|
" copied announcement: " .. param ..
|
|
" unsuccessfully, message: " .. message)
|
|
return false, message
|
|
end
|
|
end
|
|
}
|
|
|
|
minetest.register_chatcommand(chatcommand_cmd, chatcommand_definition)
|