Update roll (le return ne fonctionnais pas dans la fonction embedColor)

This commit is contained in:
*x1
2024-05-27 22:33:53 +02:00
parent 049cd9fedb
commit 89aa9ea851
+28 -22
View File
@@ -5,7 +5,7 @@ const db = require('../../fonctions/database.js');
module.exports = {
aliases: ['roulette'],
description: 'Lance une roulette.',
emote: '🎲',
emote: '🎲',
utilisation: '<mise> <couleur>',
permission: 0,
@@ -18,9 +18,10 @@ module.exports = {
.setColor(color)
.setTimestamp()
.setFooter({ text: `Demandé par ${message.author.tag}`, iconURL: message.author.displayAvatarURL() })
return message.reply({ embeds: [embed], allowedMentions: { repliedUser: false } })
});
message.reply({ embeds: [embed], allowedMentions: { repliedUser: false } })
});
return
} else if (isNaN(args[0])) {
embedColor(message.author.id, message.guild.id).then(color => {
const embed = new EmbedBuilder()
@@ -29,9 +30,10 @@ module.exports = {
.setColor(color)
.setTimestamp()
.setFooter({ text: `Demandé par ${message.author.tag}`, iconURL: message.author.displayAvatarURL() })
return message.reply({ embeds: [embed], allowedMentions: { repliedUser: false } })
});
message.reply({ embeds: [embed], allowedMentions: { repliedUser: false } })
});
return
} else if (args[0] < 25) {
embedColor(message.author.id, message.guild.id).then(color => {
const embed = new EmbedBuilder()
@@ -40,9 +42,10 @@ module.exports = {
.setColor(color)
.setTimestamp()
.setFooter({ text: `Demandé par ${message.author.tag}`, iconURL: message.author.displayAvatarURL() })
return message.reply({ embeds: [embed], allowedMentions: { repliedUser: false } })
message.reply({ embeds: [embed], allowedMentions: { repliedUser: false } })
});
return
} else if (args[1] !== 'rouge' && args[1] !== 'noir' && args[1] !== 'vert' && args[1] !== 'red' && args[1] !== 'black' && args[1] !== 'green') {
embedColor(message.author.id, message.guild.id).then(color => {
const embed = new EmbedBuilder()
@@ -51,9 +54,10 @@ module.exports = {
.setColor(color)
.setTimestamp()
.setFooter({ text: `Demandé par ${message.author.tag}`, iconURL: message.author.displayAvatarURL() })
return message.reply({ embeds: [embed], allowedMentions: { repliedUser: false } })
});
message.reply({ embeds: [embed], allowedMentions: { repliedUser: false } })
});
return
}
const pocket = await new Promise((resolve, reject) => {
@@ -69,9 +73,9 @@ module.exports = {
.setColor(color)
.setTimestamp()
.setFooter({ text: `Demandé par ${message.author.tag}`, iconURL: message.author.displayAvatarURL() })
return message.reply({ embeds: [embed], allowedMentions: { repliedUser: false } })
});
return message.reply({ embeds: [embed], allowedMentions: { repliedUser: false } })
});
} else {
resolve(row.pocket);
}
@@ -87,7 +91,7 @@ module.exports = {
.setColor(color)
.setTimestamp()
.setFooter({ text: `Demandé par ${message.author.tag}`, iconURL: message.author.displayAvatarURL() })
return message.reply({ embeds: [embed], allowedMentions: { repliedUser: false } })
});
@@ -109,7 +113,7 @@ module.exports = {
} else if ((args[1] === 'vert' || args[1] === 'green') && colorR === 'vert') {
gain = args[0] * 36;
} else {
gain = 0-args[0];
gain = 0 - args[0];
}
await new Promise((resolve, reject) => {
@@ -130,20 +134,22 @@ module.exports = {
.setColor(color)
.setTimestamp()
.setFooter({ text: `Demandé par ${message.author.tag}`, iconURL: message.author.displayAvatarURL() })
return message.reply({ embeds: [embed], allowedMentions: { repliedUser: false } })
message.reply({ embeds: [embed], allowedMentions: { repliedUser: false } })
});
return
} else {
embedColor(message.author.id, message.guild.id).then(color => {
const embed = new EmbedBuilder()
.setTitle('🎲 Roulette')
.setDescription(`Vous avez misé \`${args[0]}\` sur \`${args[1]}\` et la bille est tombée sur \`${colorR}\`. Vous avez perdu \`${0-gain}\` !`)
.setDescription(`Vous avez misé \`${args[0]}\` sur \`${args[1]}\` et la bille est tombée sur \`${colorR}\`. Vous avez perdu \`${0 - gain}\` !`)
.setColor(color)
.setTimestamp()
.setFooter({ text: `Demandé par ${message.author.tag}`, iconURL: message.author.displayAvatarURL() })
return message.reply({ embeds: [embed], allowedMentions: { repliedUser: false } })
message.reply({ embeds: [embed], allowedMentions: { repliedUser: false } })
});
return
}
}
};