After about 20 hours of searching for answers, editing the code, and trying new methods. I've given up and decided to ask here.
I'm absolutely sick of this piece of code.
What I'm trying to do is: 1. Wait for a message to receive 2 reactions 2. After 2 reactions, post message to a separate channel
EDIT: After some users recommended removing my stupidly placed console.log before my .then this code now proceeds to not wait for a reaction on a message and go through the entire process without posting a message to the specified channel
Please bear with me, I'm still learning.
Here's the code:
client.on('message', msg => {
const filter = (reaction, user) => reaction.emoji.name === '703033480090484756' && user.id === message.author.id;
msg.awaitReactions(filter, { max: 1, time: 30000, errors: ['time'] })
.then(collected => {
const starboard = new Discord.MessageEmbed()
.setColor(0xFF0000)
.setAuthor(`${msg.author.username}`, `${msg.author.avatarURL()}`)
.setDescription(`${msg.author.content}`)
client.channels.cache.get('714842643766444122').send(starboard)})
.catch(err => console.log(err), ('Passed! Added to starboard.'));
console.log('Added to Starboard!');
If you need more details, Please ask.
question from:
https://stackoverflow.com/questions/65650069/discord-js-then-is-not-defined-even-though-its-in-a-function 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…