I would have liked to add to my bot discord a feature to mutate everyone in a vocal lounge when I launch an order but I do not find how. My bot was programmed using Node.js with discord.js. Can someone help me? Thank you :)
My code :
const Discord = require("discord.js");
module.exports.run = async (client, message, args) => {
if(!message.member.hasPermission("MANAGE_MESSAGES")) return message.channel.send("Vous n'\avez pas les permissions pour utiliser cette commande !");
let voiceChannel = message.guild.channels
.filter(function (channel) { return channel.id === '540093524570406912' })
.first()
voiceChannel
.join()
.then(function (connection) {
connection.members.setMute(true);
})
}
module.exports.help = {
name:"start"
}
Regards,
Quentin S