Skip to content

Conversation

@0x46616c6b
Copy link
Member

This pull request refactors how Telegram bot settings are handled and exposed in the API, moving away from direct configuration file access and toward a dedicated storage-backed settings system. It introduces new endpoints and response structures for Telegram settings, updates feature detection logic, and ensures that the Telegram bot username is sourced from stored settings rather than config. The changes also include comprehensive test coverage for the new Telegram settings functionality.

@0x46616c6b 0x46616c6b added the enhancement New feature or request label Sep 25, 2025
@0x46616c6b 0x46616c6b requested a review from Copilot September 25, 2025 20:14
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request refactors Telegram bot configuration from a static config-based approach to a dynamic storage-backed system. It removes Telegram configuration from the config struct and introduces new storage methods, API endpoints, and response structures for managing Telegram settings through the database.

  • Removes Telegram configuration from config files and moves to database storage
  • Adds new storage methods for getting/saving Telegram settings with comprehensive test coverage
  • Updates bridge logic to source Telegram tokens from storage instead of config
  • Introduces new API endpoints for managing Telegram settings dynamically

Reviewed Changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
internal/storage/storage.go Adds interface methods for Telegram settings storage
internal/storage/sql_storage.go Implements Telegram settings CRUD operations
internal/storage/setting.go Defines TelegramSettings struct and constants
internal/config/config.go Removes Telegram configuration struct and methods
internal/bridge/telegram.go Updates bridge to use storage-backed Telegram settings
internal/api/settings.go Adds API endpoints for Telegram settings management
internal/api/features.go Updates feature detection to use storage-backed settings
internal/api/tickers.go Updates ticker responses to use dynamic bot username
cmd/root.go Removes startup Telegram bot initialization

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +598 to +600
// TODO: Get actual bot username from Telegram API or cache it
// For now, return empty string since we don't want to make API calls here
return ""
Copy link

Copilot AI Sep 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The TODO comment indicates incomplete functionality. The method always returns an empty string regardless of whether a valid token exists, which makes the bot username feature non-functional. Consider implementing proper username retrieval or updating the method documentation to reflect the current limitation.

Copilot uses AI. Check for mistakes.
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants