From 109df2354cc65714ac5b5384a9b740ceb1046b45 Mon Sep 17 00:00:00 2001 From: Vladless Date: Fri, 16 May 2025 08:51:43 +0300 Subject: [PATCH] add tariffs stats --- bot.py | 2 +- handlers/admin/tariffs/tariffs_handler.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/bot.py b/bot.py index 74148800..e3a704a5 100644 --- a/bot.py +++ b/bot.py @@ -19,7 +19,7 @@ bot = Bot(token=API_TOKEN, default=DefaultBotProperties(parse_mode=ParseMode.HTM storage = MemoryStorage() dp = Dispatcher(bot=bot, storage=storage) -version = "4.3-dev" +version = "4.3-b160510" register_middleware(dp) diff --git a/handlers/admin/tariffs/tariffs_handler.py b/handlers/admin/tariffs/tariffs_handler.py index 74856278..23cdc947 100644 --- a/handlers/admin/tariffs/tariffs_handler.py +++ b/handlers/admin/tariffs/tariffs_handler.py @@ -230,6 +230,7 @@ async def view_tariff(callback: CallbackQuery, callback_data: AdminTariffCallbac t = dict(tariff) traffic_text = f"{t['traffic_limit'] // 1024**3} ГБ" if t["traffic_limit"] else "Безлимит" + device_text = f"{t['device_limit']}" if t["device_limit"] is not None else "Безлимит" text = ( f"📄 Тариф: {t['name']}\n\n" @@ -237,6 +238,7 @@ async def view_tariff(callback: CallbackQuery, callback_data: AdminTariffCallbac f"📅 Длительность: {t['duration_days']} дней\n" f"💰 Стоимость: {t['price_rub']}₽\n" f"📦 Трафик: {traffic_text}\n" + f"📱 Устройств: {device_text}\n" f"{'✅ Активен' if t['is_active'] else '⛔ Отключен'}" )