From d8e499bcfb9c4124af53a77511bb184ef3c7f8e9 Mon Sep 17 00:00:00 2001 From: Vladless Date: Mon, 2 Dec 2024 03:37:28 +0300 Subject: [PATCH] pc button for trial_key --- handlers/keys/trial_key.py | 2 +- handlers/start.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/handlers/keys/trial_key.py b/handlers/keys/trial_key.py index 7117a435..819d66da 100644 --- a/handlers/keys/trial_key.py +++ b/handlers/keys/trial_key.py @@ -17,7 +17,7 @@ async def create_trial_key(tg_id: int, session: Any): email = generate_random_email() public_link = f"{PUBLIC_LINK}{email}/{tg_id}" instructions = INSTRUCTIONS - result = {"key": public_link, "instructions": instructions} + result = {"key": public_link, "instructions": instructions, "email": email} current_time = datetime.utcnow() expiry_time = current_time + timedelta(days=TRIAL_TIME) expiry_timestamp = int(expiry_time.timestamp() * 1000) diff --git a/handlers/start.py b/handlers/start.py index 915b8ded..22b31b98 100644 --- a/handlers/start.py +++ b/handlers/start.py @@ -80,6 +80,8 @@ async def handle_connect_vpn(callback_query: CallbackQuery, session: Any): f"📋 Быстрая инструкция по подключению:\n{INSTRUCTIONS_TRIAL}" ) + email = trial_key_info["email"] + builder = InlineKeyboardBuilder() builder.row(InlineKeyboardButton(text="💬 Поддержка", url=SUPPORT_CHAT_URL)) builder.row( @@ -96,6 +98,7 @@ async def handle_connect_vpn(callback_query: CallbackQuery, session: Any): url=f'{CONNECT_ANDROID}{trial_key_info["key"]}', ), ) + builder.row(InlineKeyboardButton(text="💻 Windows/Linux", callback_data=f"connect_pc|{email}")) builder.row(InlineKeyboardButton(text="👤 Личный кабинет", callback_data="profile")) await callback_query.message.answer(key_message, reply_markup=builder.as_markup())