diff --git a/app/services/menu_layout/constants.py b/app/services/menu_layout/constants.py index 2ef26e83..8bd96980 100644 --- a/app/services/menu_layout/constants.py +++ b/app/services/menu_layout/constants.py @@ -493,7 +493,7 @@ AVAILABLE_CALLBACKS: List[Dict[str, Any]] = [ DYNAMIC_PLACEHOLDERS: List[Dict[str, str]] = [ {"placeholder": "{balance}", "description": "Баланс пользователя", "example": "1 500 ₽", "category": "user"}, {"placeholder": "{username}", "description": "Имя пользователя", "example": "John", "category": "user"}, - {"placeholder": "{subscription_days_left}", "description": "Дней до окончания подписки", "example": "14", "category": "subscription"}, + {"placeholder": "{subscription_days}", "description": "Дней до окончания подписки", "example": "14", "category": "subscription"}, {"placeholder": "{traffic_used}", "description": "Использованный трафик", "example": "5.2 GB", "category": "subscription"}, {"placeholder": "{traffic_left}", "description": "Оставшийся трафик", "example": "94.8 GB", "category": "subscription"}, {"placeholder": "{referral_count}", "description": "Количество рефералов", "example": "12", "category": "referral"}, diff --git a/app/services/menu_layout/context.py b/app/services/menu_layout/context.py index fc6aeb13..5f0a24a3 100644 --- a/app/services/menu_layout/context.py +++ b/app/services/menu_layout/context.py @@ -25,7 +25,7 @@ class MenuContext: custom_buttons: List[InlineKeyboardButton] = field(default_factory=list) # Расширенные поля для плейсхолдеров и условий username: str = "" - subscription_days_left: int = 0 + subscription_days: int = 0 traffic_used_gb: float = 0.0 traffic_left_gb: float = 0.0 referral_count: int = 0 diff --git a/app/services/menu_layout/service.py b/app/services/menu_layout/service.py index 040e1c42..d7d73323 100644 --- a/app/services/menu_layout/service.py +++ b/app/services/menu_layout/service.py @@ -870,8 +870,8 @@ class MenuLayoutService: text = text.replace("{username}", context.username or "User") # Дней до окончания подписки - if "{subscription_days_left}" in text: - text = text.replace("{subscription_days_left}", str(context.subscription_days_left)) + if "{subscription_days}" in text: + text = text.replace("{subscription_days}", str(context.subscription_days_left)) # Использованный трафик if "{traffic_used}" in text: