Added message_org module
This commit is contained in:
38
modpol_core/modules/message_org.lua
Normal file
38
modpol_core/modules/message_org.lua
Normal file
@ -0,0 +1,38 @@
|
||||
--- message_org
|
||||
-- @module message_org
|
||||
|
||||
local message_org = {
|
||||
name = "Message org",
|
||||
slug = "message_org",
|
||||
desc = "Send a message to all members of the org",
|
||||
hide = false;
|
||||
}
|
||||
|
||||
message_org.data = {
|
||||
}
|
||||
|
||||
message_org.config = {
|
||||
}
|
||||
|
||||
-- @function initiate
|
||||
function message_org:initiate(result)
|
||||
modpol.interactions.text_query(
|
||||
self.initiator, "Message to all org members: ",
|
||||
function(input)
|
||||
local message = self.initiator.." to org "..
|
||||
self.org.name..": "..input
|
||||
if input and input ~= "" then
|
||||
modpol.interactions.message_org(
|
||||
self.initiator, self.org.id, message)
|
||||
end
|
||||
modpol.interactions.org_dashboard(
|
||||
self.initiator, self.org.id)
|
||||
|
||||
end
|
||||
)
|
||||
if result then result() end
|
||||
self.org:delete_process(self.id)
|
||||
end
|
||||
|
||||
--- (Required) Add to module table
|
||||
modpol.modules.message_org = message_org
|
Reference in New Issue
Block a user