if (availableQuantity >= quantity) {
async function withdrawBNB(wallet, quantity) {
// ...
// Transaction logic using web3
// ...
};
withdrawBNB(wallet, quantity)
.then((response) => {
interaction.reply(`You have successfully withdrawn ${quantity} ${cryptoName} to wallet ${wallet}. TxHash: ${response.txHash}`);
})
.catch((error) => {
console.error(error);
interaction.reply('Failed to withdraw BNB. Please try again later.');
});
}
if (availableQuantity >= quantity) {
async function withdrawBNB(wallet, quantity) {
// ...
// Transaction logic using web3
// ...
};
withdrawBNB(wallet, quantity)
.then((response) => {
interaction.reply(`You have successfully withdrawn ${quantity} ${cryptoName} to wallet ${wallet}. TxHash: ${response.txHash}`);
})
.catch((error) => {
console.error(error);
interaction.reply('Failed to withdraw BNB. Please try again later.');
});
}