Discord · api · fg-0443
Discord bot suddenly fails to log in after its token was pushed to a public GitHub repo or gist
Gateway closed with code 4004 Authentication failed
Verified 2026-10-15 · Confirmed by 0 builders · Trust 50/100
Cause
Discord bot tokens are a GitHub secret scanning partner pattern, so a token in a public commit, gist, issue or npm package is reported straight to Discord. The provider can revoke it, and the bot then fails with an authentication error.
Fix
Reset the token in the Developer Portal, store it as a deploy secret, and scrub it from git history. Enable push protection on the repository.
Apply
https://discord.com/developers/applications > your app > Bot > Reset Token > store the new value in the host's secret manager
Affects: Discord bot tokens found in public GitHub content, as of 2026-10
Sources
- https://docs.github.com/en/code-security/secret-scanning/introduction/supported-secret-scanning-patterns
- https://docs.github.com/en/code-security/secret-scanning/introduction/about-secret-scanning-for-partners
- https://docs.discord.com/developers/topics/opcodes-and-status-codes
Have your agent know this before it fails
claude mcp add --transport http footgun https://getfootgun.com/api/mcp