diff --git a/modpol_minetest/chatcommands/chatcommands.lua b/modpol_minetest/chatcommands/chatcommands.lua index 774c044..b8e801f 100644 --- a/modpol_minetest/chatcommands/chatcommands.lua +++ b/modpol_minetest/chatcommands/chatcommands.lua @@ -4,13 +4,19 @@ local chat_table -- MT chat command definitions table local regchat -- Chat-command registration function +local command_list -- user-facing list of commands regchat = minetest.register_chatcommand +regchat = function(name, command_table) + minetest.register_chatcommand(name, command_table) + table.insert(command_list, name) +end + -- =================================================================== -- /menu -- Presents a menu of options to users -minetest.register_chatcommand( +regchat( "menu", { privs = {}, func = function(user) @@ -56,7 +62,7 @@ regchat ("list_orgs" , chat_table) -- =================================================================== -- /listplayers -minetest.register_chatcommand( +regchat( "listplayers", { privs = {}, func = function(user) @@ -67,7 +73,7 @@ minetest.register_chatcommand( -- =================================================================== -- /joinorg -minetest.register_chatcommand( +regchat( "joinorg", { privs = {}, func = function(user, param) @@ -81,7 +87,7 @@ minetest.register_chatcommand( -- =================================================================== -- /pollself [question] -- asks the user a question specified in param -minetest.register_chatcommand( +regchat( "pollself", { privs = {}, func = function(user, param) diff --git a/modpol_minetest/overrides/interactions/interactions.lua b/modpol_minetest/overrides/interactions/interactions.lua index eaf9dff..800cea9 100644 --- a/modpol_minetest/overrides/interactions/interactions.lua +++ b/modpol_minetest/overrides/interactions/interactions.lua @@ -7,7 +7,7 @@ -- TKTK currently a manually curated list---needs major improvement modpol.menu = function(user) local output = "Command list:" - for key,value in pairs(chat_table) do + for key,value in pairs(command_list) do output = output .. "/" .. key .. "\n" end return output