I have tried to overwrite permissions denying speak but it only applies when members leave and join the vc. I have also tried "member.setMute(true)" but it mutes members globally, so they cant speak in any channel and I would like just to mute in one specific channel.
1
votes
Please take a look at existing answers on StackOverflow and see if they answer your question. E.g. Your question is already answered here stackoverflow.com/q/55081354/5947203
– Ani
@Ani I already saw that question, and that's why I said that I tried using member.setMute, but I need to mute the users just in one voice channel and not in the whole server.
– L SP
consider going through similar answers again. For e.g. stackoverflow.com/q/62887805/5947203 or stackoverflow.com/q/55081354/5947203
– Ani
1 Answers
0
votes
Try doing the following:
voiceChannel.members.forEach(m => {
m.voice.setMute(1).catch(err =>{})
})
Here, it cycles through all the members in voiceChannel
and server-mutes them. You can do m.voice.setMute(0)
to unmute them. Additionally, if the command is being sent by a member that's in a specific voice channel, you can replace voiceChannel
with message.member.voice.channel
.
The catch is important in case it tries to mute someone who is already muted.