Skip to content

Commit

Permalink
Don't post mods with no concerns
Browse files Browse the repository at this point in the history
  • Loading branch information
Pickysaurus committed Dec 2, 2024
1 parent 97ff482 commit ab0fab4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/feeds/AutoModManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ab0fab4

Please sign in to comment.