hubot icon indicating copy to clipboard operation
hubot copied to clipboard

Is it possible to have nested modules and in which case how?

Open gonace opened this issue 2 years ago • 0 comments

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

This file is called serie.js and is located under the scripts folder.

const floorball = require('./serie/floorball/index');
const hockey = require('./serie/hockey/index');

const command = {
    floorball ,
    hockey,
};
module.exports = command;

Both './serie/floorball/index' and './serie/floorball/index' looks like this

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');
  });
};

But this does not work, any ideas?

gonace avatar Jun 15 '22 06:06 gonace