Skip to content

Potential fix for code scanning alert no. 3: Incomplete string escaping or encoding#33

Merged
n3m01726 merged 1 commit intomainfrom
alert-autofix-3
May 6, 2026
Merged

Potential fix for code scanning alert no. 3: Incomplete string escaping or encoding#33
n3m01726 merged 1 commit intomainfrom
alert-autofix-3

Conversation

@n3m01726
Copy link
Copy Markdown
Owner

@n3m01726 n3m01726 commented May 6, 2026

Potential fix for https://github.com/n3m01726/discord-bot/security/code-scanning/3

Use a regex replacement that targets the named import block and appends MessageFlags inside it, instead of replacing the first } character.

Best fix in this file:

  • In scripts/bot/fix-ephemeral.js, replace line 32 logic with a capture-group based regex replacement:
    • Match import { ... } from 'discord.js'
    • Capture the inside of braces
    • Rebuild the import as import { <existing>, MessageFlags } from 'discord.js'
  • This avoids first-occurrence string replacement and makes the transformation explicit and stable.
  • No new imports or dependencies are needed.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

…ng or encoding

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@n3m01726 n3m01726 marked this pull request as ready for review May 6, 2026 16:36
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@n3m01726 n3m01726 merged commit 370b920 into main May 6, 2026
2 checks passed
@n3m01726 n3m01726 deleted the alert-autofix-3 branch May 6, 2026 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant