Closed gonace closed 1 year ago
Hubot's loadScripts
API expects a module to export a function with a single argument like
module.exports = (robot) => {}
But scripts/serie.js
exports an object.
I think if you try something like the following, you might get what you want.
const floorball = require('./serie/floorball/index');
const hockey = require('./serie/hockey/index');
const command = {
floorball ,
hockey,
};
module.exports = (robot) =>{
floorball(robot);
hockey(robot);
};
Closing for now.
I'm trying to include nested modules but can't get it to work, is it possible in which case how?
This is what I'm trying out but can't get to work
const command = { floorball , hockey, }; module.exports = command;
module.exports = (robot) => { robot.hear(/serie floorball help/i, (res) => { res.reply('Test'); }); };
module.exports = (robot) => { robot.hear(/serie hockey help/i, (res) => { res.reply('Test'); }); };