diff --git a/handlers/profile.py b/handlers/profile.py index 005aecf1..baf787f8 100644 --- a/handlers/profile.py +++ b/handlers/profile.py @@ -68,7 +68,11 @@ async def view_tariffs_handler(callback_query: types.CallbackQuery): builder = InlineKeyboardBuilder() builder.row(InlineKeyboardButton(text="👤 Личный кабинет", callback_data="profile")) - await callback_query.message.answer( + # Путь к изображению + image_path = os.path.join("img", "tariffs.jpg") # Убедитесь, что этот путь правильный + + # Формируем текст с тарифами + tariffs_message = ( "🚀 Доступные тарифы VPN:\n\n" + "\n".join( [ @@ -77,10 +81,26 @@ async def view_tariffs_handler(callback_query: types.CallbackQuery): f"{'💳' if months == '1' else '🌟' if months == '3' else '🔥' if months == '6' else '🚀'} рублей" for months in sorted(RENEWAL_PLANS.keys(), key=int) ] - ), - reply_markup=builder.as_markup(), + ) ) + # Проверяем наличие файла изображения + if os.path.isfile(image_path): + # Если изображение существует, отправляем его + with open(image_path, "rb") as image_file: + await callback_query.message.answer_photo( + photo=BufferedInputFile(image_file.read(), filename="tariffs.jpg"), + caption=tariffs_message, + reply_markup=builder.as_markup(), + ) + else: + # Если изображения нет, просто отправляем текст + await callback_query.message.answer( + text=tariffs_message, + reply_markup=builder.as_markup(), + ) + + @router.callback_query(F.data == "invite") async def invite_handler(callback_query: types.CallbackQuery): diff --git a/handlers/start.py b/handlers/start.py index 3c15d9bc..93df5511 100644 --- a/handlers/start.py +++ b/handlers/start.py @@ -116,4 +116,4 @@ async def handle_about_vpn(callback_query: CallbackQuery): ) builder.row(InlineKeyboardButton(text="⬅️ Назад", callback_data="start")) - await callback_query.message.answer(get_about_vpn("3.2.2-Release"), reply_markup=builder.as_markup()) + await callback_query.message.answer(get_about_vpn("3.2.21-Release"), reply_markup=builder.as_markup()) diff --git a/img/tariffs.jpg b/img/tariffs.jpg new file mode 100644 index 00000000..1064f788 Binary files /dev/null and b/img/tariffs.jpg differ