Skip to content

Drop node-telegram-bot-api to fix 7 of 8 Dependabot alerts - #10

Merged
DrummingBird1 merged 1 commit into
mainfrom
claude/practical-napier-053ddf
Sep 2, 2026
Merged

Drop node-telegram-bot-api to fix 7 of 8 Dependabot alerts#10
DrummingBird1 merged 1 commit into
mainfrom
claude/practical-napier-053ddf

Conversation

@DrummingBird1

Copy link
Copy Markdown
Owner

Summary

GitHub reported 8 Dependabot alerts (1 critical, 2 high, 5 moderate) the first time pnpm-lock.yaml was committed to git — a first-visibility event, not a new regression.

Traced each alert directly via gh api repos/DrummingBird1/RedAlert/dependabot/alerts:

  • 7 of 8 (request, form-data ×2 incl. the critical one, qs ×2, uuid, tough-cookie) all trace to one chain: the deprecated request/@cypress/request client pulled in transitively by node-telegram-bot-api@0.66.0 (an optionalDependency). That library's only actual use in this repo was new TelegramBot(token, {polling:false}) + bot.sendMessage(...) — a single Telegram Bot API call. telegram-bot.js is rewritten to POST to api.telegram.org directly via raw https (same zero-dep pattern as sendDiscord() in server.js), and node-telegram-bot-api is dropped from package.json entirely. No npm install step needed anymore for the Telegram bot.
  • 1 of 8 (js-yaml, high) comes from eslint@9.39.5@eslint/eslintrc, a devDependency only, never reachable from any code path (the project never parses untrusted YAML — docs/openapi.yaml is static and served as-is). Fixing it requires eslint v10, which needs a .eslintrc.json → flat-config migration and raising the Node engine requirement to ^20.19 || ^22.13 || >=24 (currently >=18). Documented as an accepted, deferred risk in .github/SECURITY.md rather than fixed here.

Note: there's an existing open Dependabot PR proposing node-telegram-bot-api 0.66.0 → 2.1.0 — that's a from-scratch API rewrite with no v1 compatibility, not a safe drop-in bump. This PR removes the dependency instead, so that Dependabot PR becomes moot once this merges.

Test plan

  • node --check telegram-bot.js
  • Scratch-tested the new sendTelegramMessage() request/response/error-handling logic against a local mock HTTP server (success, API error, network error paths)
  • node test/unit.js — 91/91 pass
  • node test/integration.js — 12/12 pass
  • pnpm install --frozen-lockfile — lockfile consistent
  • pnpm why confirms request/form-data/qs/uuid/tough-cookie/node-telegram-bot-api are all gone from the dependency tree

🤖 Generated with Claude Code

telegram-bot.js only ever called sendMessage() once, so replace the
deprecated request/@cypress/request-based library with a raw https
POST to api.telegram.org (same zero-dep pattern as sendDiscord() in
server.js). This removes the whole request/form-data/qs/uuid/tough-cookie
chain that accounted for 7 of the 8 alerts GitHub reported on first
lockfile visibility. The remaining js-yaml alert (eslint devDependency,
not reachable from any code path) is documented as an accepted risk in
SECURITY.md.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Sep 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
red-alert Ready Ready Preview Sep 2, 2026 4:41am UTC

@DrummingBird1
DrummingBird1 merged commit d89b37a into main Sep 2, 2026
8 of 9 checks passed
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