Basic Reaction Logic (1/2)
The start of the logic for handling reactions.
const awaitReactions = async (msg, m, options, filter) => {
// simplify the use of these options, using destructing^
const { min, max, page, limit } = options;
m.awaitReactions(filter, { max: 1, time: limit, errors: ['time'] })
.then(async (collected) => {
// logic
}).catch(() => {});
}const reaction = collected.first();// add this below where we define reaction, but inside the '.then'
if (reaction.emoji.name === '⬅') {
// a.
}
else if (reaction.emoji.name === '➡') {
// b.
}
else if (reaction.emoji.name === '🗑') {
// c.
}
else {
// d.
}Last updated