diff options
Diffstat (limited to 'packages')
| -rw-r--r-- | packages/gateway/src/listeners/aiModeration.ts | 12 |
1 files changed, 6 insertions, 6 deletions
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<string> { +): Promise<string> => { 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) => { |