Making the bot collect reactions from said message

This commit is contained in:
Alex 2020-08-03 17:05:02 -05:00
parent be9a4f81f3
commit 66fbc34df6
1 changed files with 11 additions and 8 deletions

View File

@ -59,10 +59,19 @@ client.on('message', async message => {
message.channel.send("Who wants to play with the beach ball?")
.then(message => {
// Reacts to its own message
message.react(config.emoteID)
.catch((err) => {
console.error('Something went wrong', err)
})
message.awaitReactions(filter, {max: 25, time: 60000, errors: ['time']})
.then(collected => {
const reaction = collected.first();
if (reaction.emoji === emote) {
players = reaction.users;
}
})
})
.catch((err) => {
console.error("Something went wrong!", err)
@ -70,15 +79,9 @@ client.on('message', async message => {
)
}
)
;
// going to change this to an on. statement and try making it more "JS" I think I see where you are going.
message.awaitReactions(filter, {max: 1, time: 60000, errors: ['time']})
.then(collected => {
const reaction = collected.first();
if (reaction.emoji === emote) {
players = reaction.users;
}
})
//This will start passing the ball