Skip to content

Commit

Permalink
reasoning with fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Szedann committed Jan 1, 2024
1 parent 29d19c7 commit 5ebc348
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/handlers/spam.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,11 @@ export const spamHandler: Handler = (client) => {
)
).reduce((a, b) => ({
level: a.level + b.level,
reasons: new Set(...a.reasons, ...b.reasons),
reasons: new Set([...a.reasons, ...b.reasons]),
}));

suspicion.level += otherSuspicions.level;
suspicion.reasons = new Set(
...suspicion.reasons,
otherSuspicions.reasons
);
suspicion.reasons = new Set([...suspicion.reasons, ...otherSuspicions.reasons]);

const logChannel = await message.guild?.channels.fetch(
process.env.MESSAGE_LOGS_CHANNEL
Expand All @@ -189,7 +186,7 @@ export const spamHandler: Handler = (client) => {
suspicion.level
} for ${message.author}, from message ${
message.url
}\nreasons:${[...suspicion.reasons.values()].join(
}\nreasons:\n${[...suspicion.reasons.values()].join(
'\n'
)}`,
}),
Expand Down

0 comments on commit 5ebc348

Please sign in to comment.