Answer the question
In order to leave comments, you need to log in
It is necessary that the bot react only to the reactions of those who are in the voice channel. How?
The team performs the function of kicking a participant from the voice channel on a complaint. Now it works so that if a user files a complaint, then anyone who clicks on "✅" or "❌", the bot will work. I need the bot to react only to the reactions of those who are in the same voice channel with me.
Not relevant
Answer the question
In order to leave comments, you need to log in
1. Write the voice channel of the creator of this "vote" to a variable.
const creationChannel = message.member.voice.channel
const REFRESH_INTERVAL = 1000
const creationChannel = message.member.voice.channel
const refreshIntervalHandler = setInterval( async () => {
creationChannel = await creationChannel.fetch(true)
}, REFRESH_INTERVAL)
const reactionFilter = (reaction, user) => creationChannel.members.find(member => member.user.id === user.id)
const collector = sentMessage.createReactionCollector(reactionFilter, {max : 1})
collector.on('end', () => clearInterval(refreshIntervalHandler ))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question