diff --git a/src/commands/credits/addons/transfer.js b/src/commands/credits/addons/transfer.js index 5cb0576..08cd4c3 100644 --- a/src/commands/credits/addons/transfer.js +++ b/src/commands/credits/addons/transfer.js @@ -45,6 +45,17 @@ module.exports = async (interaction) => { const fromUser = await credits.findOne({ userId: from.id, guildId: interaction.member.guild.id }); const toUser = await credits.findOne({ userId: to.id, guildId: interaction.member.guild.id }); + if (!toUser) { + const embed = { + title: 'Set', + description: 'That user has no credits, I can not set credits to 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;