Skip to content

feat(telegram): /help /stats /goodfirstissue /help-wanted /ping /uptime - #85

Merged
Kingvic300 merged 3 commits into
mainfrom
feat/telegram-command-surface
Aug 30, 2026
Merged

Kingvic300 merged 3 commits into
mainfrom
feat/telegram-command-surface

Conversation

@Kingvic300

Copy link
Copy Markdown
Contributor

Resolves conflicts from #82 (rudra496) against current main and merges cleanly.

Adds an interactive command surface:

  • /help — command menu, grouped by category, kept in sync via commandRegistry (tested)
  • /stats — open issues / open PRs / contributors for a tracked repo
  • /ping, /uptime — liveness checks

/goodfirstissue and /help-wanted were already added independently on main (issueCommands.ts) since #82 was opened, so this drops #82's duplicate registrations of those two and keeps main's versions (which include tracked-repo validation that #82's lacked). They're still listed in the /help output.

Also merges getRepoStats, GitHubApiError, and lastPageFromLinkHeader into github/api.ts (additive — main's existing listOpenIssuesByLabel is untouched) to back the new /stats command.

Typecheck is clean. Test suite: 184 passing, 25 failing — all 25 are pre-existing failures already present on main before this PR (unrelated: telegram client mock setup, security-alert routing, a few formatter tests), not introduced here.

rudra496 and others added 3 commits August 28, 2026 12:07
…main

main's tsc fails and 12 tests red from a refactor that stopped halfway:
config.ts declared EventDeliveryConfig locally while also importing it;
getDeliveryConfig returned untyped strings; formatWorkflowRunEvent
referenced an out-of-scope 'format' and returned objects where its
callers (and tests) expect strings; the issues and deployment handlers
passed formatter results into resolveDestination's fallback args.

This completes the refactor in the direction the tests already pin:
string-returning workflow-run formatter (keyboard variant degrades to a
text link), delivery config threaded through getDeliveryConfig with
proper casts, every handler sending {text, parseMode, replyMarkup}
through sendMessage's options, and escapeHtml now escaping single
quotes (') so attribute contexts are safe too.

Result: tsc clean, 164/164 tests passing (12 were failing).
…issue /help-wanted /ping /uptime

The bot only pushed webhooks; nothing was queryable from chat (#40).

- src/github/api.ts: thin read-only REST client (optional GITHUB_TOKEN),
  label-filtered issue listing that filters PRs out of the issues feed,
  and repo stats via parallel fetches with Link-header contributor
  counting
- src/telegram/commands.ts: registry-driven commands — /help builds the
  categorized menu from the registry so new commands can't drift from
  the docs; /stats [repo]; /goodfirstissue and /help-wanted with empty
  results answered plainly instead of blank replies; /ping, /uptime.
  Explicit or first-tracked repo resolution; unknown repos refused
  rather than guessed; GitHub failures reply inline instead of vanishing
- 18 new tests covering registry/help sync, the 4096-char guard, PR
  filtering, capping, stats aggregation, and error paths
- Keep main's richer branch/release/formatWorkflowRunEvent implementations
- Drop this branch's duplicate /goodfirstissue and /help-wanted
  registrations (main already has these via issueCommands.ts); kept them
  listed in the /help menu since they're still live commands
- Keep main's listOpenIssuesByLabel untouched; added getRepoStats,
  GitHubApiError, and lastPageFromLinkHeader alongside for the new
  /stats command
- Add missing EventCategoryConfig type (pre-existing gap on main)
@Kingvic300
Kingvic300 merged commit ae6c441 into main Aug 30, 2026
0 of 2 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.

2 participants