From ab0fab4e7fe9230c4a19d3b456d7e502d0ac974d Mon Sep 17 00:00:00 2001 From: Mike Watling Date: Mon, 2 Dec 2024 14:11:30 +0000 Subject: [PATCH] Don't post mods with no concerns --- src/feeds/AutoModManager.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/feeds/AutoModManager.ts b/src/feeds/AutoModManager.ts index a7519f3..42faab1 100644 --- a/src/feeds/AutoModManager.ts +++ b/src/feeds/AutoModManager.ts @@ -103,16 +103,16 @@ export class AutoModManager { } this.addToLastReports(results); // const concerns = results.filter(m => (m.flags.high.length) !== 0); - // if (!concerns.length) { - if (!results.length) { + const concerns = results.filter(m => (m.flags.high.length) > 0 || (m.flags.low.length) > 0); + if (!concerns.length) { logMessage('No mods with concerns found.') return; } else { try { - logMessage('Reporting mods:', results.map(c => `${c.mod.name} - ${c.flags.high.join(', ')} - ${c.flags.low.join(', ')}`)); - await PublishToSlack(flagsToSlackMessage(results)); - await PublishToDiscord(flagsToDiscordEmbeds(results)); + logMessage('Reporting mods:', concerns.map(c => `${c.mod.name} - ${c.flags.high.join(', ')} - ${c.flags.low.join(', ')}`)); + await PublishToSlack(flagsToSlackMessage(concerns)); + await PublishToDiscord(flagsToDiscordEmbeds(concerns)); } catch(err) { logMessage('Error posting automod to Discord or Slack', err, true)