remove_org.lua 786 B

123456789101112131415161718192021222324252627282930313233
  1. --- @module Remove Org
  2. -- A simple module that removes an org.
  3. --- Main module table
  4. remove_org = {
  5. name = "Remove this org",
  6. slug = "remove_org",
  7. desc = "Removes an org if all members consent."
  8. }
  9. remove_org.config = {}
  10. remove_org.data = {}
  11. --- Initiate function
  12. -- @function initiate
  13. function remove_org:initiate(result)
  14. if self.org == modpol.instance then
  15. modpol.interactions.message(
  16. self.initiator,
  17. "You cannot remove the root org")
  18. else
  19. modpol.interactions.message_org(
  20. self.initiator,self.org.id,
  21. "Removing org: "..self.org.name)
  22. self.org:delete()
  23. modpol.interactions.dashboard(self.initiator)
  24. -- call result function
  25. end
  26. if result then result() end
  27. end
  28. modpol.modules.remove_org = remove_org