2018-03-13 03:26:03 +01:00
|
|
|
const logger = require('winston');
|
|
|
|
|
2018-03-10 01:45:24 +01:00
|
|
|
function SlackConfig () {
|
|
|
|
this.slackWebHook = 'default';
|
|
|
|
this.slackErrorChannel = 'default';
|
|
|
|
this.slackInfoChannel = 'default';
|
2018-03-13 03:26:03 +01:00
|
|
|
this.configure = (config) => {
|
|
|
|
if (!config) {
|
|
|
|
return logger.warn('No slack config received.');
|
|
|
|
}
|
|
|
|
const {slackWebHook, slackErrorChannel, slackInfoChannel} = config;
|
|
|
|
this.slackWebHook = slackWebHook;
|
|
|
|
this.slackErrorChannel = slackErrorChannel;
|
|
|
|
this.slackInfoChannel = slackInfoChannel;
|
2018-03-10 01:45:24 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = new SlackConfig();
|