← Back to PRs

#21804: fix: improve type safety and use project runtime logging

by hobostay open 2026-02-20 11:55 View on GitHub →
channel: discord channel: telegram size: XS
This PR improves type safety and logging consistency: - Add `DiscordMemberLike` type to replace 'any' in sender-identity.ts - Replace direct console usage with defaultRuntime in telegram modules - Improves type safety and logging consistency across the codebase ## Changes - **Type Safety**: Replaced 'any' types with proper TypeScript interfaces - **Logging**: Unified console logging to use the project's runtime logging system - **Consistency**: All logging now goes through the same abstraction layer ## Files Changed - src/discord/monitor/sender-identity.ts - src/telegram/accounts.ts - src/telegram/bot-access.ts - src/telegram/bot.ts - src/telegram/monitor.ts - src/telegram/send.ts All changes pass the pre-commit hooks (oxlint, oxfmt) and TypeScript type checking. <!-- greptile_comment --> <h3>Greptile Summary</h3> This PR improves type safety and standardizes logging across Discord and Telegram modules: - Replaced `any` type with explicit `DiscordMemberLike` type in `src/discord/monitor/sender-identity.ts`, improving type safety for the `member` parameter - Unified logging across all Telegram modules by replacing direct `console.log`, `console.warn`, and `console.error` calls with `defaultRuntime.log` and `defaultRuntime.error` - All changes are consistent with the project's runtime logging abstraction defined in `src/runtime.ts`, which provides centralized control over logging behavior (including test environment suppression and progress line clearing) <h3>Confidence Score: 5/5</h3> - This PR is safe to merge with minimal risk - All changes are low-risk refactorings that improve code quality. The type safety improvement replaces `any` with a properly typed interface, and the logging standardization uses the existing project runtime abstraction. Changes passed pre-commit hooks (oxlint, oxfmt) and TypeScript type checking. - No files require special attention <sub>Last reviewed commit: 0f82a7a</sub> <!-- greptile_other_comments_section --> <sub>(4/5) You can add custom instructions or style guidelines for the agent [here](https://app.greptile.com/review/github)!</sub> <!-- /greptile_comment -->

Most Similar PRs