title: Discord.js - Detect if a message has an image or a link
body: <p>So I'm something of a beginner to making bots and I'm semi-comfortable in the space I'm at now only poking around at Discord.js, but I've encountered an issue that I can't seem to move forward on.</p>
  
  <p>I have something of a joke bot that's supposed to detect if a person's sent an image or a link, output a reply, and then delete the image (or link). (Really, I'd prefer to delete anything that isn't text, but I need the response to say exactly what kind of media it is, so I don't care if it's particularly limited...)</p>
  
  <p>Here's what I have:</p>
  
  <pre><code>//remove instances of images
  if (message.attachments.length &gt; 0) {
      message.channel.send(`${message.author} sent an image!`);
      message.channel.send('This constitutes revelry and merriment and is strictly outlawed!')
      message.delete();
  }
  //remove instances of links
  if (message.embeds.length &gt; 0) {
      message.channel.send(`${message.author} sent an link!`);
      message.channel.send('This constitutes revelry and merriment and is strictly outlawed!')
      message.delete();
  }
  </code></pre>
  
  <p>However, if I send an image, it simply does nothing.</p>
  
  <p>Thanks in advance!</p>
  
  <p>edit: I'd also like to say that the bot has other functionality that works perfectly (reacting, deleting, replying to mentions of certain words), so hopefully the only relevant code should be above.</p>