diff options
| author | Fuwn <[email protected]> | 2025-09-25 18:25:31 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2025-09-25 18:25:31 -0700 |
| commit | 106b8480dfd8e81f53151ce538ad8d4d3f7f9064 (patch) | |
| tree | 5bedd434c749dea203b8148633e930a23874d898 /packages | |
| parent | fix(gateway:aiModeration): Add brief explanation field to alert embed (diff) | |
| download | umabotdiscord-106b8480dfd8e81f53151ce538ad8d4d3f7f9064.tar.xz umabotdiscord-106b8480dfd8e81f53151ce538ad8d4d3f7f9064.zip | |
fix(gateway:aiModeration): Add user message deletion notification
Diffstat (limited to 'packages')
| -rw-r--r-- | packages/gateway/src/listeners/aiModeration.ts | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/packages/gateway/src/listeners/aiModeration.ts b/packages/gateway/src/listeners/aiModeration.ts index e699bee..af84745 100644 --- a/packages/gateway/src/listeners/aiModeration.ts +++ b/packages/gateway/src/listeners/aiModeration.ts @@ -308,6 +308,21 @@ export const handleAIModeration = (client: Client) => { try { 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.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 delete message:", error); } |