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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user