message_org.lua 903 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. --- message_org
  2. -- @module message_org
  3. local message_org = {
  4. name = "Message org",
  5. slug = "message_org",
  6. desc = "Send a message to all members of the org",
  7. hide = false;
  8. }
  9. message_org.data = {
  10. }
  11. message_org.config = {
  12. }
  13. -- @function initiate
  14. function message_org:initiate(result)
  15. modpol.interactions.text_query(
  16. self.initiator, "Message to all org members: ",
  17. function(input)
  18. local message = self.initiator.." to org "..
  19. self.org.name..": "..input
  20. if input and input ~= "" then
  21. modpol.interactions.message_org(
  22. self.initiator, self.org.id, message)
  23. end
  24. modpol.interactions.org_dashboard(
  25. self.initiator, self.org.id)
  26. end
  27. )
  28. if result then result() end
  29. self.org:delete_process(self.id)
  30. end
  31. --- (Required) Add to module table
  32. modpol.modules.message_org = message_org