title: Bot looping through directory for mp4 specific file
body: <p>I'm trying to make a bot where it would upload a mp4 attachment with a specific command. What i wanted to know is if there was a way where the bot would cycle through the directory for the certain file instead of me writing like 600 lines worth of code.</p>
  <pre><code>const fs = require('fs');
  const { Client, MessageAttachment } = require('discord.js');
  const config = require('./config.json');
  const { prefix, token } = require('./config.json');
  const client = new Client();
  const { MessageEmbed } = require('discord.js');
  client.commands = new Discord.Collection();
  
  
  
  const commandFiles = fs.readdirSync('./commands').filter(file =&gt; file.endsWith('.js'));
  for (const file of commandFiles) {
      const command = require(`./commands/${file}`);
  
      client.commands.set(command.name, command);
  }
  
  
  client.on('ready', () =&gt; {
    console.log(`${client.user.tag} is now online!`);
    client.user.setPresence({status: 'idle'});
    client.user.setActivity('My Stokeley Playlist ', { type: 'LISTENING' })
  });
  
  client.on('message', (message) =&gt; {
    const { content, author, channel } = message
    if (author.bot) {
      return
    }
  
    const embeds = {
      [`${prefix}snip kratos`]: {
        title: 'Kratos',
        attachmentPath: './snippets/kratos/Kratos.mp4',
      },
      [`${prefix}snip johnny bravo`]: {
        title: 'Johnny Bravo',
        attachmentPath: './snippets/Johnny_Bravo/Johnny_Bravo.mp4',
      },
    }
  
    const embed = embeds[content]
    if (embed) {
      const { title, attachmentPath } = embed
  
      channel.send(
        new MessageEmbed()
          .setColor('#ffb638')
          .setTitle(title)
          .setDescription('Sending 1 snippet...')
          .setTimestamp()
          .setFooter('SkiBot')
      )
      channel.send(new MessageAttachment(attachmentPath))
    }
  })
  
  here's my current code, I'm trying to find an easier and cleaner way to go about this.
  
  </code></pre>