User start registration update function

This commit is contained in:
NW
2024-12-16 12:37:44 +00:00
parent 2cfa37ea86
commit d51bc9f0b9
2 changed files with 27 additions and 19 deletions

View File

@@ -539,6 +539,22 @@ export default class UserProductHandler {
// Получение баланса пользователя
const userBalance = await UserService.getUserBalance(user.id);
// Проверка баланса пользователя
if (userBalance <= 0) {
await bot.sendMessage(
chatId,
`❌ Insufficient balance. Your current balance is $${userBalance}. You need $${totalPrice} to complete this purchase.`,
{
reply_markup: {
inline_keyboard: [[
{ text: '💰 Top Up Balance', callback_data: 'top_up_wallet' }
]]
}
}
);
return;
}
if (userBalance < totalPrice) {
await bot.sendMessage(
chatId,