Adding and fixing basic modules for renaming, removing, and adding orgs

This commit is contained in:
Nathan Schneider
2021-12-19 16:00:26 -07:00
parent d4599e9bbe
commit 53d2a25f42
15 changed files with 371 additions and 130 deletions

View File

@ -15,10 +15,10 @@ regchat = function(name, command_table)
end
-- ===================================================================
-- /modpol
-- /mp
-- Presents a menu of options to users
regchat(
"modpol", {
"mp", {
privs = {},
func = function(user)
modpol.interactions.dashboard(user)
@ -26,14 +26,17 @@ regchat(
})
-- ===================================================================
-- /reset
-- For testing only
-- /mptest
-- For testing only, accessible to admin users
-- Clears the system and recreates instance with all players
-- opens dashboard too for fun.
regchat(
"reset", {
privs = {},
"mptest", {
privs = {privs=true},
func = function(user)
modpol.orgs.reset();
modpol.orgs.reset()
modpol.instance:add_member(user)
modpol.interactions.dashboard(user)
return true, "Reset orgs"
end,
})
@ -71,38 +74,3 @@ regchat(
end
})
-- ===================================================================
-- /listplayers
regchat(
"listplayers", {
privs = {},
func = function(user)
local result = table.concat(modpol.list_users(),", ")
return true, "All players: " .. result
end,
})
-- ===================================================================
-- /joinorg
regchat(
"joinorg", {
privs = {},
func = function(user, param)
local org = modpol.orgs.get_org(param)
local success, result = org:add_member(user)
return true, result
end,
})
-- ===================================================================
-- /pollself [question]
-- asks the user a question specified in param
regchat(
"pollself", {
privs = {},
func = function(user, param)
modpol.interactions.binary_poll_user(user, param)
return true, result
end,
})