const { Client, Attachment, Message, MessageEmbed } = require("discord.js");
const items = [ "Test1", "Test2", "Test3"
]
const item = items[Math.floor(Math.random() * items.length)];
module.exports = {
name: "test",
description: "",
/**
* @param {Message} message
* @param {Client} client
*/
execute(message, args, client) {
const mess = "You win:"
var embed = new MessageEmbed();
if (item == "Test1") {
embed.setDescription(mess + " Test1")
} else if (item == "Test2") {
embed.setDescription(mess + " Test2")
} else if (item == "Test3") {
embed.setDescription(mess + " Test3")
}
embed.setTitle("tEsT")
embed.setColor('#bd2ecc')
const embed1 = new MessageEmbed()
.setTitle("Searching...")
.setColor("bd2ecc")
message.channel.send({embeds: [embed1]}).then((msg) => {
setTimeout(function() {
msg.edit({content: "\n", embeds: [embed]})
}, 3000)
});
}
};
I'm trying to get the embed to respond to one of the contents of "items", unfortunately nothing is generated randomly, and I'm wondering how to fix this, I have about a guess because only test3 is always displayed, but no idea how to fix it
I hope someone can help me