Struggling with creating a Discord.js giveaway command that involves sending an embed, saving it to the variable embedSent, collecting reactions post TimeOut using the reactions.get() method, converting them into an array with array(), and then filtering them with .filter(). The issue arises at the Array() step where I continuously encounter the error
TypeError: peopleReactedBot.array is not a function
. Taking a look at the specific part of my code :
embedSent.react("🎉");
setTimeout(function () {
try {
const peopleReactedBot = embedSent.reactions.cache.get("🎉").users.fetch();
const peopleReacted = peopleReactedBot.array().filter(u => u.id !== client.author.id);
message.channel.send(peopleReacted)
} catch(e) {
return message.channel.send("An error has occured : `"+e+"`");
}
}, time);
Using Discord.js v12.