Revert "Add automatic Telegram Stars rate fetching and toggle"

This commit is contained in:
Egor
2025-11-01 00:55:55 +03:00
committed by GitHub
parent ace7121a4e
commit da46c18210
8 changed files with 0 additions and 550 deletions

View File

@@ -164,7 +164,6 @@ class Settings(BaseSettings):
TELEGRAM_STARS_ENABLED: bool = True
TELEGRAM_STARS_RATE_RUB: float = 1.3
TELEGRAM_STARS_CUSTOM_RATE_ENABLED: bool = False
TRIBUTE_ENABLED: bool = False
TRIBUTE_API_KEY: Optional[str] = None
@@ -1122,23 +1121,6 @@ class Settings(BaseSettings):
)
def get_stars_rate(self) -> float:
"""Возвращает актуальный курс Telegram Stars в рублях."""
if self.TELEGRAM_STARS_CUSTOM_RATE_ENABLED:
return self.TELEGRAM_STARS_RATE_RUB
try:
from app.services.telegram_stars_rate_service import ( # pylint: disable=import-outside-toplevel
telegram_stars_rate_service,
)
telegram_stars_rate_service.ensure_refresh()
cached_rate = telegram_stars_rate_service.get_cached_rate()
if cached_rate:
return cached_rate
except Exception as error: # pragma: no cover - защитный блок от циклических импортов
logger.debug("Не удалось получить актуальный курс Stars: %s", error)
return self.TELEGRAM_STARS_RATE_RUB
def stars_to_rubles(self, stars: int) -> float: