← Back to PRs

#3174: Telegram: restore types after removing ts-nocheck

by yashgo0018 open 2026-01-28 06:19 View on GitHub →
channel: telegram
## Summary - remove ts-nocheck and restore typing across Telegram bot pipeline - add shared Telegram message context types and typed handler signatures - tighten proxy fetch typing and sticker cache guard ## Testing - not run (typing-only changes) ## AI assistance - AI-assisted (Codex CLI) - I reviewed the changes and understand them ## Notes - Focused on type safety after ts-nocheck removal; no runtime behavior change intended <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR removes `// @ts-nocheck` across the Telegram bot pipeline and restores stricter typing by introducing shared Telegram context types, typed handler signatures, and improved typing around proxy fetch and sticker caching. The changes primarily touch the Telegram inbound handler/dispatch path (`bot-handlers` → `buildTelegramMessageContext` → `dispatchTelegramMessage`) to make context and message processing explicitly typed, with an aim of preserving existing runtime behavior while increasing type safety. <h3>Confidence Score: 2/5</h3> - Not safe to merge as-is due to a likely runtime exception and a draft-streaming logic regression. - Two changes look behavior-affecting despite the stated intent: (1) `getFile.bind(...) ?? fallback` can throw if `getFile` is missing at runtime and the fallback is effectively dead, and (2) the `canStreamDraft` gate appears to disable streaming in typical private chats by requiring a forum-thread id. The rest of the PR is mostly type-shaping and low risk. - src/telegram/bot-handlers.ts, src/telegram/bot-message-dispatch.ts <!-- greptile_other_comments_section --> <sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub> <!-- /greptile_comment -->

Most Similar PRs