join_org_consent.lua 595 B

123456789101112131415161718192021222324252627282930
  1. JoinOrg = {}
  2. JoinOrg.setup = {
  3. name = "Join an org",
  4. slug = "join_org_consent",
  5. desc = "Consent based join org module"
  6. }
  7. function JoinOrg:initiate()
  8. self.org:call_module(
  9. "consent",
  10. self.initiator,
  11. {
  12. prompt = "Allow " .. self.initiator .. " to join?",
  13. votes_required = 1
  14. },
  15. function ()
  16. self:complete()
  17. end
  18. )
  19. end
  20. function JoinOrg:complete()
  21. self.org:add_member(self.initiator)
  22. print("Added " .. self.initiator .. " to the org!")
  23. end
  24. modpol.modules.join_org_consent = JoinOrg