summaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
Diffstat (limited to 'packages')
-rw-r--r--packages/gateway/src/listeners/aiModeration.ts42
1 files changed, 22 insertions, 20 deletions
diff --git a/packages/gateway/src/listeners/aiModeration.ts b/packages/gateway/src/listeners/aiModeration.ts
index 3a42d76..03087aa 100644
--- a/packages/gateway/src/listeners/aiModeration.ts
+++ b/packages/gateway/src/listeners/aiModeration.ts
@@ -7,6 +7,7 @@ import {
} from "discord.js";
import { sendAuditLog } from "../commands/utilities";
+const SKIP_ACTION = false;
const EXCLUDED_CATEGORIES = [
"1406422619934167103", // Staff
"1420604833286852608", // Staff Automation
@@ -314,29 +315,30 @@ export const handleAIModeration = (client: Client) => {
(analysis.severity === "critical" || analysis.severity === "high") &&
analysis.confidence >= 75
) {
- try {
- await message.delete();
- console.log(`AI Moderation: Auto-deleted high severity violation`);
-
+ if (!SKIP_ACTION)
try {
- const notificationText = `${message.author}, your message was deleted: **${analysis.brief}**. This notification will be deleted in 10 seconds.`;
- const notificationMessage = await (message.channel as any).send(
- notificationText,
- );
-
- setTimeout(async () => {
- try {
- await notificationMessage.delete();
- } catch (error) {
- console.error("Failed to delete notification message:", error);
- }
- }, 10000);
+ await message.delete();
+ console.log(`AI Moderation: Auto-deleted high severity violation`);
+
+ try {
+ const notificationText = `${message.author}, your message was deleted: **${analysis.brief}**. This notification will be deleted in 10 seconds.`;
+ const notificationMessage = await (message.channel as any).send(
+ notificationText,
+ );
+
+ setTimeout(async () => {
+ try {
+ await notificationMessage.delete();
+ } catch (error) {
+ console.error("Failed to delete notification message:", error);
+ }
+ }, 10000);
+ } catch (error) {
+ console.error("Failed to send notification message:", error);
+ }
} catch (error) {
- console.error("Failed to send notification message:", error);
+ console.error("Failed to delete message:", error);
}
- } catch (error) {
- console.error("Failed to delete message:", error);
- }
} else {
console.log(
`AI Moderation: Logging violation for human review (severity: ${analysis.severity}, confidence: ${analysis.confidence}%)`,