autoname for trial in profile

This commit is contained in:
Vladless
2024-11-28 20:48:34 +03:00
parent 2b4e3182c7
commit 00efebc377
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -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")
+1 -1
View File
@@ -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}")