Files
modpol/modpol/modules/join_org_consent.lua
2021-12-16 16:52:06 -05:00

30 lines
595 B
Lua

JoinOrg = {}
JoinOrg.setup = {
name = "Join an org",
slug = "join_org_consent",
desc = "Consent based join org module"
}
function JoinOrg:initiate()
self.org:call_module(
"consent",
self.initiator,
{
prompt = "Allow " .. self.initiator .. " to join?",
votes_required = 1
},
function ()
self:complete()
end
)
end
function JoinOrg:complete()
self.org:add_member(self.initiator)
print("Added " .. self.initiator .. " to the org!")
end
modpol.modules.join_org_consent = JoinOrg