From 00efebc3773aa218662c4eaea0b4eef883fa89c4 Mon Sep 17 00:00:00 2001 From: Vladless Date: Thu, 28 Nov 2024 20:48:34 +0300 Subject: [PATCH] autoname for trial in profile --- handlers/keys/key_management.py | 4 ++-- handlers/payments/stars_pay.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/handlers/keys/key_management.py b/handlers/keys/key_management.py index af512003..53b6c7a6 100644 --- a/handlers/keys/key_management.py +++ b/handlers/keys/key_management.py @@ -53,6 +53,7 @@ async def process_callback_create_key(callback_query: CallbackQuery, state: FSMC async def select_server(callback_query: CallbackQuery, state: FSMContext, session: Any): trial_status = await get_trial(callback_query.message.chat.id, session) if trial_status == 1: + # Если триал есть, бот предлагает подключить новое устройство builder = InlineKeyboardBuilder() builder.row( InlineKeyboardButton(text="✅ Да, подключить новое устройство", callback_data="confirm_create_new_key") @@ -65,8 +66,7 @@ async def select_server(callback_query: CallbackQuery, state: FSMContext, sessio ) await state.update_data(creating_new_key=True) else: - await callback_query.message.answer(KEY_TRIAL) - await state.set_state(Form.waiting_for_key_name) + await handle_key_creation(callback_query.message.chat.id, state, session, callback_query) @router.callback_query(F.data == "confirm_create_new_key") diff --git a/handlers/payments/stars_pay.py b/handlers/payments/stars_pay.py index 3bb3136e..0ed46279 100644 --- a/handlers/payments/stars_pay.py +++ b/handlers/payments/stars_pay.py @@ -184,4 +184,4 @@ async def on_successful_payment( await update_balance(user_id, amount) await send_payment_success_notification(user_id, amount) except ValueError as e: - logger.error(f"Ошибка конвертации user_id или amount: {e}") + logger.error(f"Ошибка конвертации user_id или amount: {e}") \ No newline at end of file