your-land/yl_announcements#6 Adds examples to the help of each command

This commit is contained in:
AliasAlreadyTaken 2024-05-29 01:56:17 +02:00
parent 075454a57f
commit b6959b46bc
7 changed files with 20 additions and 13 deletions

View File

@ -1,7 +1,8 @@
local chatcommand_cmd = "announcement_add" local chatcommand_cmd = "announcement_add"
local chatcommand_definition = { local chatcommand_definition = {
params = "<message>$<frequency in seconds>$<runtime in seconds>", params = "<message>$<frequency in seconds>$<runtime in seconds>",
description = "Sends the message each frequency seconds for a maximum number of runtime seconds.", description = "Sends the message each frequency seconds for a maximum number of runtime seconds." ..
"\nExample: /announcement_add Runs every 50 seconds for one hour (= 3600 seconds)$50$3600",
privs = {[yl_announcements.settings.admin_privs] = true}, privs = {[yl_announcements.settings.admin_privs] = true},
func = function(name, param) func = function(name, param)
local success, message = yl_announcements.chatcommand_announcement_add( local success, message = yl_announcements.chatcommand_announcement_add(

View File

@ -1,7 +1,8 @@
local chatcommand_cmd = "announcement_copy" local chatcommand_cmd = "announcement_copy"
local chatcommand_definition = { local chatcommand_definition = {
params = "<announcement ID>", -- Short parameter description params = "<announcement ID>",
description = "Open the announcement with ID in a formspec, so it can be copied.", -- Full description description = "Open the announcement with ID in a formspec, so it can be copied." ..
"\nExample: /announcement_copy 5",
privs = {[yl_announcements.settings.user_privs] = true}, privs = {[yl_announcements.settings.user_privs] = true},
func = function(name, param) func = function(name, param)
local success, message = yl_announcements.chatcommand_announcement_copy( local success, message = yl_announcements.chatcommand_announcement_copy(

View File

@ -1,7 +1,8 @@
local chatcommand_cmd = "announcement_delete" local chatcommand_cmd = "announcement_delete"
local chatcommand_definition = { local chatcommand_definition = {
params = "<announcement ID>", -- Short parameter description params = "<announcement ID>",
description = "Delete the announcement ID.", -- Full description description = "Delete the announcement ID." ..
"\nExample: /announcement_delete 5",
privs = {[yl_announcements.settings.admin_privs] = true}, privs = {[yl_announcements.settings.admin_privs] = true},
func = function(name, param) func = function(name, param)
local success, message = local success, message =

View File

@ -1,7 +1,8 @@
local chatcommand_cmd = "announcement_list" local chatcommand_cmd = "announcement_list"
local chatcommand_definition = { local chatcommand_definition = {
params = "<announcement ID>", -- Short parameter description params = "<announcement ID>",
description = "List announcement with ID to you.", -- Full description description = "List announcement with ID to you." ..
"\nExample: /announcement_list 5",
privs = {[yl_announcements.settings.user_privs] = true}, privs = {[yl_announcements.settings.user_privs] = true},
func = function(name, param) func = function(name, param)
local success, message = yl_announcements.chatcommand_announcement_list( local success, message = yl_announcements.chatcommand_announcement_list(

View File

@ -1,7 +1,8 @@
local chatcommand_cmd = "announcement_list_all" local chatcommand_cmd = "announcement_list_all"
local chatcommand_definition = { local chatcommand_definition = {
params = "", -- Short parameter description params = "",
description = "Lists all announcements to you.", -- Full description description = "Lists all announcements to you." ..
"\nExample: /announcement_list_all",
privs = {[yl_announcements.settings.user_privs] = true}, privs = {[yl_announcements.settings.user_privs] = true},
func = function(name, param) func = function(name, param)
local success, message = local success, message =

View File

@ -1,7 +1,8 @@
local chatcommand_cmd = "announcement_say" local chatcommand_cmd = "announcement_say"
local chatcommand_definition = { local chatcommand_definition = {
params = "<announcement ID>", -- Short parameter description params = "<announcement ID>",
description = "Say the announcement with ID in main chat.", -- Full description description = "Say the announcement with ID in main chat." ..
"\nExample: /announcement_say 5",
privs = {[yl_announcements.settings.admin_privs] = true}, privs = {[yl_announcements.settings.admin_privs] = true},
func = function(name, param) func = function(name, param)
local success, message = yl_announcements.chatcommand_announcement_say( local success, message = yl_announcements.chatcommand_announcement_say(

View File

@ -1,7 +1,8 @@
local chatcommand_cmd = "announcement_say_all" local chatcommand_cmd = "announcement_say_all"
local chatcommand_definition = { local chatcommand_definition = {
params = "", -- Short parameter description params = "",
description = "Say all announcements in main chat.", -- Full description description = "Say all announcements in main chat." ..
"\nExample: /announcement_say_all",
privs = {[yl_announcements.settings.admin_privs] = true}, privs = {[yl_announcements.settings.admin_privs] = true},
func = function(name, param) func = function(name, param)
local success, message = local success, message =