🥅 fromUser does not exist

This commit is contained in:
Axel Olausson Holtenäs 2022-03-06 14:30:25 +01:00
parent 81c78aed7f
commit b5b84b4862
No known key found for this signature in database
GPG key ID: E3AE7E194AE017ED

View file

@ -56,6 +56,17 @@ module.exports = async (interaction) => {
return interaction.editReply({ embeds: [embed], ephemeral: true });
}
if (!fromUser) {
const embed = {
title: 'Transfer',
description: 'That user has no credits, I can not transfer credits from the user',
color: config.colors.error,
timestamp: new Date(),
footer: { iconURL: config.footer.icon, text: config.footer.text },
};
return interaction.editReply({ embeds: [embed], ephemeral: true });
}
fromUser.balance -= amount;
toUser.balance += amount;