-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
37 lines (31 loc) · 925 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
module.exports = function(product_name, slack_hooks){
var slack_info = [];
var slack_bug = [];
slack_hooks.forEach(function(account){
var Slack = require('slack-notify')(account.hook);
var info = Slack.extend({
channel: account.channel,
icon_emoji: account.info_emoji,
username: product_name + " (info)"
});
var bug = Slack.extend({
channel: account.channel,
icon_emoji: account.bug_emoji,
username: product_name + " (bug)"
});
slack_info.push(info);
slack_bug.push(bug);
});
return {
info: function(options){
slack_info.forEach(function(slack){
slack(options);
});
},
bug: function(options){
slack_bug.forEach(function(slack){
slack(options);
});
}
}
};