Merge pull request #113 from Vladless/hteppl-optimize-sources

Hteppl optimize sources
This commit is contained in:
Vladislav Lisitsyn
2024-12-10 04:14:24 +02:00
committed by GitHub
3 changed files with 24 additions and 4 deletions
+23 -3
View File
@@ -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 = (
"<b>🚀 Доступные тарифы VPN:</b>\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):
+1 -1
View File
@@ -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())
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB