From c6d372c080b6512c0e4477f95df204aa70758859 Mon Sep 17 00:00:00 2001 From: Zakhar Izmaylov Date: Sun, 24 Nov 2024 10:35:12 +0300 Subject: [PATCH] Fix get_trial --- handlers/keys/key_management.py | 4 ++-- handlers/notifications.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/handlers/keys/key_management.py b/handlers/keys/key_management.py index 6cede92f..afbbaa9f 100644 --- a/handlers/keys/key_management.py +++ b/handlers/keys/key_management.py @@ -34,7 +34,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 = get_trial(callback_query.message.from_user.id, session) + trial_status = await get_trial(callback_query.message.from_user.id, session) logger.info(f'trial_status {trial_status}') if trial_status == 1: builder = InlineKeyboardBuilder() @@ -107,7 +107,7 @@ async def handle_key_name_input(message: Message, state: FSMContext, session: An expiry_time = None logger.info(f"Checking trial status for user {tg_id}.") - trial_status = get_trial(message.from_user.id, session) + trial_status = await get_trial(message.from_user.id, session) if trial_status == 0: expiry_time = current_time + timedelta(days=1, hours=3) diff --git a/handlers/notifications.py b/handlers/notifications.py index 505e0db2..5432ecc5 100644 --- a/handlers/notifications.py +++ b/handlers/notifications.py @@ -98,7 +98,7 @@ async def notify_10h_keys( if not await is_bot_blocked(bot, tg_id): try: - keyboard = types.InlineKeyboardBuilder() + keyboard = InlineKeyboardBuilder() keyboard.button(text="🔄 Продлить VPN", callback_data=f'renew_key|{record["client_id"]}') keyboard.button(text="💳 Пополнить баланс", callback_data="pay") keyboard.button(text="👤 Личный кабинет", callback_data="profile")