added module template, added support for module parameters and default values through the config table

This commit is contained in:
Luke Miller
2021-12-16 14:03:42 -05:00
parent 826f9600b5
commit 6e02e254aa
2 changed files with 41 additions and 3 deletions
+29
View File
@@ -0,0 +1,29 @@
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