From 1f7d1a144cc739e70d48ff9e5853c1e9720a3401 Mon Sep 17 00:00:00 2001 From: Artyom Ashirov <1323ED5@gmail.com> Date: Thu, 21 Nov 2024 17:58:45 +0300 Subject: [PATCH] bonus balance --- src/handlers/userHandler.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/handlers/userHandler.js b/src/handlers/userHandler.js index 3dcac62..1e190c1 100644 --- a/src/handlers/userHandler.js +++ b/src/handlers/userHandler.js @@ -35,6 +35,7 @@ export default class UserHandler { const userId = msg.from.id; try { + await User.recalculateBalance(userId); const userStats = await User.getUserStats(userId); if (!userStats) { @@ -56,7 +57,8 @@ export default class UserHandler { ├ Total Purchases: ${userStats.purchase_count || 0} ├ Total Spent: $${userStats.total_spent || 0} ├ Active Wallets: ${userStats.crypto_wallet_count || 0} -└ Total Balance: $${userStats.total_balance || 0} +├ Bonus Balance: $${userStats.bonus_balance || 0} +└ Total Balance: $${(userStats.total_balance || 0) + (userStats.bonus_balance || 0)} 📅 Member since: ${new Date(userStats.created_at).toLocaleDateString()} `;