working version of join_org module demonstrated in tests/new_module_test.lua
This commit is contained in:
37
modpol/modules/join_org_class.lua
Normal file
37
modpol/modules/join_org_class.lua
Normal file
@@ -0,0 +1,37 @@
|
||||
-- JOIN ORG
|
||||
-- Module that enables a user to join an org
|
||||
|
||||
modpol.modules.join_org = {}
|
||||
module = modpol.modules.join_org
|
||||
|
||||
JoinOrg = {}
|
||||
JoinOrg_mt = { __index = JoinOrg }
|
||||
|
||||
|
||||
function JoinOrg:create(initiator, org)
|
||||
local inst = {
|
||||
name = "Join an org",
|
||||
desc = "Initiator chooses an org to become a member of. Nothing happens if they are already in an org."
|
||||
}
|
||||
setmetatable(inst, JoinOrg_mt)
|
||||
return inst
|
||||
|
||||
end
|
||||
|
||||
function JoinOrg:initiate(initiator, org, result)
|
||||
modpol.interactions.binary_poll_user(initiator, "Would you like to join", )
|
||||
end
|
||||
|
||||
function JoinOrg:request()
|
||||
|
||||
end
|
||||
|
||||
function JoinOrg:implement()
|
||||
self.org:add_member(self.initiator)
|
||||
end
|
||||
|
||||
-- ===================================
|
||||
-- When calling a module internally
|
||||
|
||||
test = JoinOrg.create()
|
||||
test:initiate("luke")
|
||||
Reference in New Issue
Block a user