So I try to make reaction collector that pause/play the music after user react to the reaction, But my collector stops when user react 1 time (the user can't react twice, only once), how can i fix it? this is my code:
queue.textChannel.send(thing).then((question) => {
question.react('⏸');
question.react('▶️');
question.react('⬅️');
question.react('⏹️');
const filter = (reaction, user) => {
return ['⏹️', '⬅️','⏸','▶️'].includes(reaction.emoji.name) && !user.bot;
};
const collector = question.createReactionCollector(filter, {
max: 1,
time: 0
});
collector.on('end', (collected, reason) => {
if (reason === 'time') {
msg.reply('Times Up');
} else {
const userReaction = collected.array()[0];
const emoji = userReaction._emoji.name;
I fixed it by changing the collector from 'end' to 'collect' and deleted the max: option.
queue.textChannel.send(thing).then((question) => {
question.react('⏸');
question.react('▶️');
question.react('⬅️');
question.react('⏹️');
const filter = (reaction, user) => {
return ['⏹️', '⬅️','⏸','▶️'].includes(reaction.emoji.name) && !user.bot;
};
const collector = question.createReactionCollector(filter, { time: 400000 });
collector.on('collect', (reaction, reactionCollector) => {
const emoji = reaction.emoji.name;
@ZsoltMeszaros Helped me with the right answer.