title: Make a dog command in Discord.JS
body: <p>I'm trying to figure out how to make a command that makes a <code>GET</code> request to <a href="https://dog.ceo/api/breeds/image/random" rel="nofollow noreferrer">this dog API</a> and return the image in an embed. Here's the code I've tried:</p>
  <pre class="lang-js prettyprint-override"><code>const Discord = require('discord.js');
  const fetch = require('node-fetch');
  
  module.exports = {
    name: 'afv!dog',
    description: 'Grab a cute doggo from dog.ceo',
    execute(msg, args, bot) {
      const prevmsg = msg
      const fetchEmbed = new Discord.MessageEmbed()
        .setColor('#e3dcd3')
        .setTitle(':dog: Woof! Let me find you a doggo! &lt;a:AFVloading:748218375909539923&gt;')
        .setDescription(&quot;This shouldn't take long...&quot;)
      msg.reply(fetchEmbed).then(msg =&gt; {
        const { message } = await fetch('https://dog.ceo/api/breeds/image/random').then(response =&gt; response.text());
        console.log(message)
        const doneEmbed = new Discord.MessageEmbed()
        .setColor('#e3dcd3')
        .setTitle(':dog: Woof! Found one!')
        .setImage(message)
        msg.delete();
        prevmsg.channel.send(doneEmbed);
      })
    },
  };
  </code></pre>
  <p>This happens when I try to run <code>index.js</code>:</p>
  <pre><code>const { message } = await fetch('https://dog.ceo/api/breeds/image/random').then(response =&gt; response.json());
                            ^^^^^
  
  SyntaxError: await is only valid in async function
  </code></pre>