From f07cc7f1e0ce0f2dc8963d8e540cbf7f34a6bcd3 Mon Sep 17 00:00:00 2001 From: n3m01726 <118871349+n3m01726@users.noreply.github.com> Date: Wed, 6 May 2026 12:34:01 -0400 Subject: [PATCH] Potential fix for code scanning alert no. 3: Incomplete string escaping or encoding Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- scripts/bot/fix-ephemeral.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/bot/fix-ephemeral.js b/scripts/bot/fix-ephemeral.js index bff6edd..10bfde7 100644 --- a/scripts/bot/fix-ephemeral.js +++ b/scripts/bot/fix-ephemeral.js @@ -29,7 +29,10 @@ function processFile (filePath) { const importMatch = content.match(/import\s+{[^}]*}\s+from\s+['"]discord\.js['"]/); if (importMatch) { // Ajouter MessageFlags à l'import existant - content = content.replace(importMatch[0], importMatch[0].replace('}', ', MessageFlags }')); + content = content.replace( + /import\s+{([^}]*)}\s+from\s+(['"]discord\.js['"])/, + (match, imports, source) => `import {${imports.trim()}, MessageFlags } from ${source}` + ); } else { // Ajouter un nouvel import content = `import { MessageFlags } from 'discord.js';\n${content}`;