title: how to get discord.js to pick a random image from file
body: <p>I'm in another pickle I've realized over the past week that my images are not loading due to the fact the links have expired so I wanna find out how to go about using a file directory in the code.</p>
  <p>Here's what I've tried:</p>
  <pre><code>});
  client.on('message', message =&gt; {
  if (message.content.startsWith('L!hug')) {
  var fs = require('fs');
  var files = fs.readdirSync('C:\Users\nevbw\Desktop\games\FBIBot\images\hugs')
  /* now files is an Array of the name of the files in the folder and you can pick a random name inside of that array */
  let chosenFile = files[Math.floor(Math.random() * files.length)] 
      }
  });
  </code></pre>
  <p>and</p>
  <pre><code>});
  client.on('message', message =&gt; {
  if (message.content.startsWith('L!hug')) {
  const path = 'C:\Users\nevbw\Desktop\games\FBIBot\images\hugs';
  const fs = require('fs');
  
  fs.readdirSync(path).forEach(file =&gt; {
  ranfile = Math.floor(Math.random() * file.length);
  message.channel.sendFile(ranfile);
  })
  }
  });
  </code></pre>