From 93fc0f45c49fad2b7ca2edb61c4fe1ada25d2ed3 Mon Sep 17 00:00:00 2001 From: Vladless Date: Sun, 2 Mar 2025 15:31:47 +0300 Subject: [PATCH] version 4.0 --- handlers/instructions/instructions.py | 5 ++++- handlers/notifications/special_notifications.py | 2 +- handlers/profile.py | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/handlers/instructions/instructions.py b/handlers/instructions/instructions.py index 92775223..a4cf5f89 100644 --- a/handlers/instructions/instructions.py +++ b/handlers/instructions/instructions.py @@ -51,10 +51,12 @@ async def process_connect_pc(callback_query: CallbackQuery, session: Any): key_name = callback_query.data.split("|")[1] record = await get_key_details(key_name, session) if not record: + builder = InlineKeyboardBuilder() + builder.row(InlineKeyboardButton(text="👤 Личный кабинет", callback_data="profile")) await edit_or_send_message( target_message=callback_query.message, text="❌ Ключ не найден. Проверьте имя ключа. 🔍", - reply_markup=types.InlineKeyboardMarkup(), + reply_markup=builder.as_markup(), media_path=None, ) return @@ -78,6 +80,7 @@ async def process_connect_pc(callback_query: CallbackQuery, session: Any): ) + @router.callback_query(F.data.startswith("connect_tv|")) async def process_connect_tv(callback_query: CallbackQuery): key_name = callback_query.data.split("|")[1] diff --git a/handlers/notifications/special_notifications.py b/handlers/notifications/special_notifications.py index a6a34040..76089778 100644 --- a/handlers/notifications/special_notifications.py +++ b/handlers/notifications/special_notifications.py @@ -34,7 +34,7 @@ async def notify_inactive_trial_users(bot: Bot, conn: asyncpg.Connection): SELECT tg_id, username, first_name, last_name FROM users WHERE tg_id IN ( SELECT tg_id FROM connections - WHERE trial = 0 + WHERE trial IN (0, -1) ) AND tg_id NOT IN ( SELECT tg_id FROM blocked_users diff --git a/handlers/profile.py b/handlers/profile.py index f4866929..b8b703f6 100644 --- a/handlers/profile.py +++ b/handlers/profile.py @@ -119,6 +119,7 @@ async def balance_handler(callback_query: CallbackQuery, session: Any): callback_query.from_user.id, ) balance = result["balance"] if result else 0.0 + balance = int(balance) builder = InlineKeyboardBuilder() builder.row(InlineKeyboardButton(text=PAYMENT, callback_data="pay"))