I'm trying to create a bot that mutes everyone currently in a voice channel by adding a role "TempMute" to them. Then when I send /unmuteAll I would like everyone who has the "TempMute" tag to have the tag removed. I have tried several different ways with no success. I am using discord.js version 12.2.0.
const Discord = require('discord.js');
voiceChatChannelId="123456789"
bot.on('message', (message) => {
var vc = bot.channels.cache.get(voiceChatChannelId);
if (message.content == '/muteAll') {
for (let member of vc.members){
//add members all to "TempMute" role
}
}
else if (message.content == '/unmuteAll') {
for (let member of vc.members){
//remove ALL members from role "TempMute"
}
}
});