1
0
mirror of https://github.com/nttgin/BGPalerter.git synced 2024-05-19 06:50:08 +00:00

fixed multiple reporting on slack

This commit is contained in:
Massimo Candela
2019-09-19 12:47:52 +02:00
parent 2116e1227b
commit 893cf3cb1f

View File

@@ -75,10 +75,13 @@ export default class ReportSlack extends Report {
report = (message, content) => {
if (this.enabled){
const groups = content.data.map(i => i.matchedRule.group);
const groups = [...new Set(content.data.map(i => i.matchedRule.group))];
for (let group of groups) {
if (this.params.hooks[group]) {
console.log(message);
this._sendSlackMessage(this.params.hooks[group], message, content);
}
}