diff --git a/app/handlers/admin/users.py b/app/handlers/admin/users.py index d0b6360c..59e52b63 100644 --- a/app/handlers/admin/users.py +++ b/app/handlers/admin/users.py @@ -4990,12 +4990,16 @@ async def admin_buy_subscription_execute(callback: types.CallbackQuery, db_user: try: if callback.bot and target_user.telegram_id: + tariff_line = '' + if settings.is_multi_tariff_enabled() and getattr(subscription, 'tariff', None): + tariff_line = f'\n📦 Тариф: «{subscription.tariff.name}»' await callback.bot.send_message( chat_id=target_user.telegram_id, text=f'💳 Администратор продлил вашу подписку\n\n' f'📅 Подписка продлена на {period_days} дней\n' f'💰 Списано с баланса: {settings.format_price(price_kopeks)}\n' - f'📅 Подписка действительна до: {format_datetime(subscription.end_date)}', + f'📅 Подписка действительна до: {format_datetime(subscription.end_date)}' + f'{tariff_line}', parse_mode='HTML', ) except Exception as e: diff --git a/app/services/monitoring_service.py b/app/services/monitoring_service.py index 31aa03eb..6070f778 100644 --- a/app/services/monitoring_service.py +++ b/app/services/monitoring_service.py @@ -1795,7 +1795,7 @@ class MonitoringService: tariff_label = f' «{subscription.tariff.name}»' message = texts.AUTOPAY_SUCCESS.format(days=days, amount=settings.format_price(amount)) if tariff_label: - message += f'\n📦 Тариф: {tariff_label}' + message += f'\n📦 Тариф:{tariff_label}' await self._send_message_with_logo( chat_id=user.telegram_id, text=message, diff --git a/app/services/promocode_service.py b/app/services/promocode_service.py index cc74df39..b660d9b0 100644 --- a/app/services/promocode_service.py +++ b/app/services/promocode_service.py @@ -336,7 +336,10 @@ class PromoCodeService: await extend_subscription(db, target_sub, promocode.subscription_days) await self.subscription_service.update_remnawave_user(db, target_sub) - effects.append(f'⏰ Подписка продлена на {promocode.subscription_days} дней') + tariff_label = '' + if settings.is_multi_tariff_enabled() and getattr(target_sub, 'tariff', None): + tariff_label = f' «{target_sub.tariff.name}»' + effects.append(f'⏰ Подписка{tariff_label} продлена на {promocode.subscription_days} дней') logger.info( '✅ Подписка пользователя продлена на дней в RemnaWave', _format_user_log=self._format_user_log(user), diff --git a/app/webapi/routes/miniapp.py b/app/webapi/routes/miniapp.py index 4b0584ca..4fd1d620 100644 --- a/app/webapi/routes/miniapp.py +++ b/app/webapi/routes/miniapp.py @@ -4484,19 +4484,35 @@ def _build_renewal_success_message( amount_label = settings.format_price(max(0, charged_amount)) date_label = format_local_datetime(subscription.end_date, '%d.%m.%Y %H:%M') if subscription.end_date else '' + tariff_label = '' + if settings.is_multi_tariff_enabled() and getattr(subscription, 'tariff', None): + tariff_label = f' «{subscription.tariff.name}»' + if language_code in {'ru', 'fa'}: if charged_amount > 0: message = ( - f'Подписка продлена до {date_label}. ' if date_label else 'Подписка продлена. ' + f'Подписка{tariff_label} продлена до {date_label}. ' + if date_label + else f'Подписка{tariff_label} продлена. ' ) + f'Списано {amount_label}.' else: - message = f'Подписка продлена до {date_label}.' if date_label else 'Подписка успешно продлена.' + message = ( + f'Подписка{tariff_label} продлена до {date_label}.' + if date_label + else f'Подписка{tariff_label} успешно продлена.' + ) elif charged_amount > 0: message = ( - f'Subscription renewed until {date_label}. ' if date_label else 'Subscription renewed. ' + f'Subscription{tariff_label} renewed until {date_label}. ' + if date_label + else f'Subscription{tariff_label} renewed. ' ) + f'Charged {amount_label}.' else: - message = f'Subscription renewed until {date_label}.' if date_label else 'Subscription renewed successfully.' + message = ( + f'Subscription{tariff_label} renewed until {date_label}.' + if date_label + else f'Subscription{tariff_label} renewed successfully.' + ) if promo_discount_value > 0: discount_label = settings.format_price(promo_discount_value)