so basically I have this giveaway command which works good but if u react with the emoji after the time u set is done it will just send "Not enough people reacted for me to draw a winner it won't pick the winner" Idk why this is happening.
client.on('message', async message =>{
if(message.content.toLowerCase().startsWith(prefix + 'giveaway')) {
if(!message.member.hasPermission("MANAGE_MESSAGES"))
return message.channel.send('You cant use this command sice youre missing `manage_messages` perm')
let args = message.content.substring(prefix.length).split(" ")
let time = args[1]
if(!time) return message.channel.send('You did not specify your time');
if(
!args[1].endsWith("d") &&
!args[1].endsWith("h") &&
!args[1].endsWith("m") &&
!args[1].endsWith("s")
)
return message.channel.send("You need to use d (days), h (hours), m (minutes), or s (seconds)")
let gchannel = message.mentions.channels.first();
if(!gchannel) return message.channel.send("I cant find that channel in the server.")
let prize = args.slice(3).join(" ")
if(!prize) return message.channel.send('What is the prize?')
message.delete()
gchannel.send(`:tada: **New Giveaway** :tada:`)
const newEmbed = new Discord.MessageEmbed()
.setTitle('New Giveaway')
.setColor("RANDOM")
.setDescription(`React with :tada: to enter the giveaway.
\nHosted By: **${message.author}** \nTime: **${time}**\nPrize: **${prize}**`)
.setFooter(`Will end in ${time}`)
let reaction = await gchannel.send(newEmbed)
reaction.react("????")
setTimeout(() => {
if ((m) => m.reaction.cache.get("????").count <= 0) {
return message.channel.send("Not enough people reacted for me to draw a winner")
}
let winner = (m) => m.reaction.cache.get("????").users.cache.filter((u) => !u.bot).random();
gchannel.send(`Congratulations ${winner} You just won the **${prize}**!`
);
}, ms(args[1]));
}
})
mcome from? You can't do that. You need to get the actual message object with the reactions on it (reaction) - Pentium1080Tireactionvariable - Pentium1080Ti.send()returns a promise that contains a Message object, which has the propertyreactionson it - Pentium1080Ti