User start registration update function
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user