29 lines
768 B
Lua
29 lines
768 B
Lua
|
|
|
||
|
|
|
||
|
|
Module = {}
|
||
|
|
|
||
|
|
Module.setup = {
|
||
|
|
name = "Module Name",
|
||
|
|
desc = "Description of the module"
|
||
|
|
}
|
||
|
|
|
||
|
|
-- defines the input parameters to the module initiate function
|
||
|
|
-- when calling a module from within another module
|
||
|
|
-- variables not defined in config will be ignored
|
||
|
|
-- default values set in config can be overridden
|
||
|
|
Module.config = {
|
||
|
|
votes_required = 5
|
||
|
|
voting_type = "majority"
|
||
|
|
}
|
||
|
|
|
||
|
|
-- Modules have access to the following instance variables
|
||
|
|
-- self.org (the org the module was called in)
|
||
|
|
-- self.initiator (the user that callced the module)
|
||
|
|
-- self.id (the process id of the module instance)
|
||
|
|
|
||
|
|
function Module:initiate(config, result)
|
||
|
|
-- call interaction functions here!
|
||
|
|
|
||
|
|
-- call result function
|
||
|
|
if result then result() end
|
||
|
|
end
|