title: Mute everyone in a voice channel with a Discord Bot with Discord.js
body: <p>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 :)</p>
  
  <p>My code :</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const Discord = require("discord.js");
  
  module.exports.run = async (client, message, args) =&gt; {
    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"
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>Regards,</p>
  
  <p>Quentin S</p>