From 0ae34b995794dbcfeccd24748663e243d23e3198 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Thu, 25 Sep 2025 15:54:00 -0700 Subject: style(gateway:aiModeration): Convert functions to arrow functions --- packages/gateway/src/listeners/aiModeration.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'packages/gateway') diff --git a/packages/gateway/src/listeners/aiModeration.ts b/packages/gateway/src/listeners/aiModeration.ts index dc0c92b..b027169 100644 --- a/packages/gateway/src/listeners/aiModeration.ts +++ b/packages/gateway/src/listeners/aiModeration.ts @@ -48,10 +48,10 @@ Regardless of which rule users have broken, if a user accumulates 15 warnings wi If you think you have received an unfair warning or punishment, please submit an appeal by using the \`/appeal\` slash command in a direct message to @UmaBot#9396. A member of the moderation team will review your appeal. `; -async function fetchMessageContext( +const fetchMessageContext = async ( channel: TextChannel | ThreadChannel, messageId: string, -): Promise { +): Promise => { try { const messages = await channel.messages.fetch({ limit: 20, @@ -78,9 +78,9 @@ async function fetchMessageContext( return "Unable to fetch message context"; } -} +}; -async function analyzeMessageWithAI( +const analyzeMessageWithAI = async ( message: Message, context: string, ): Promise<{ @@ -89,7 +89,7 @@ async function analyzeMessageWithAI( severity: "low" | "medium" | "high" | "critical"; explanation: string; confidence: number; -} | null> { +} | null> => { try { const prompt = ` You are an AI moderator for a Discord server. Analyze the following message for rule violations. @@ -190,7 +190,7 @@ If no violation is found, set "violation" to false and provide a brief explanati return null; } -} +}; export const handleAIModeration = (client: Client) => { client.on(Events.MessageCreate, async (message: Message) => { -- cgit v1.2.3