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

@ -4,7 +4,7 @@
local leave_org = {
name = "Leave org",
slug = "leave_org",
desc = "Leave this org"
desc = "Remove yourself from the current org"
}
leave_org.data = {
@ -19,9 +19,9 @@ leave_org.config = {
-- @function initiate
function leave_org:initiate(result)
if self.org == modpol.instance then
modpol.interactions.message(
self.initiator,
"You cannot leave the root org")
modpol.interactions.message(
self.initiator,
"You cannot leave the root org")
else
self.org:remove_member(self.initiator)
modpol.interactions.message_org(
@ -32,6 +32,7 @@ function leave_org:initiate(result)
"You have left org " .. self.org.name)
end
if result then result() end
self.org:delete_process(self.id)
end
--- (Required) Add to module table