🥅
This commit is contained in:
parent
109f3114c9
commit
483b7ee3a9
1 changed files with 11 additions and 0 deletions
|
@ -45,6 +45,17 @@ module.exports = async (interaction) => {
|
||||||
const fromUser = await credits.findOne({ userId: from.id, guildId: interaction.member.guild.id });
|
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 });
|
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;
|
fromUser.balance -= amount;
|
||||||
toUser.balance += amount;
|
toUser.balance += amount;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue