Files
modpol/modpol/modules/join_org_consent.lua

33 lines
801 B
Lua

--- Join org (consent)
-- A simple module that calls a consent process on an org to add a member.
-- Depends on the Consent module.
join_org_consent = {}
join_org_consent.setup = {
name = "Join this org",
slug = "join_org_consent",
desc = "Adds member with consent of all members."
}
function join_org_consent:initiate()
self.org:call_module(
"consent",
self.initiator,
{
prompt = "Allow " .. self.initiator .. " to join?",
votes_required = #self.org.members
},
function ()
self:complete()
end
)
end
function join_org_consent:complete()
self.org:add_member(self.initiator)
print("Added " .. self.initiator .. " to the org.")
end
modpol.modules.join_org_consent = join_org_consent