diff options
| author | Fuwn <[email protected]> | 2025-09-25 15:54:00 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2025-09-25 15:54:00 -0700 |
| commit | 0ae34b995794dbcfeccd24748663e243d23e3198 (patch) | |
| tree | 0b7c0fa2deb7384172082f2cd08264ff70c1deae /packages | |
| parent | fix(gateway:aiModeration): Lint (diff) | |
| download | umabotdiscord-0ae34b995794dbcfeccd24748663e243d23e3198.tar.xz umabotdiscord-0ae34b995794dbcfeccd24748663e243d23e3198.zip | |
style(gateway:aiModeration): Convert functions to arrow functions
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) => { |