remove_org_consent.lua 775 B

12345678910111213141516171819202122232425262728293031
  1. --- Remove org (consent)
  2. -- A simple module that calls a consent process on an org to remove it.
  3. -- Depends on the Consent module.
  4. remove_org_consent = {}
  5. remove_org_consent.setup = {
  6. name = "Remove this org",
  7. slug = "remove_org",
  8. desc = "Removes an org if all members consent."
  9. }
  10. function remove_org_consent:initiate()
  11. self.org:call_module(
  12. "consent",
  13. self.initiator,
  14. {
  15. prompt = "Remove org " .. self.org.name .. "?",
  16. votes_required = #self.org.members
  17. },
  18. function ()
  19. self:complete()
  20. end
  21. )
  22. end
  23. function join_org_consent:complete()
  24. self.org:delete()
  25. print("Removed org " .. self.org.name .. ".")
  26. end
  27. modpol.modules.remove_org_consent = remove_org_consent