title: How to add thumbnails to Discord embeds?
body: <p>I am creating a Discord bot that displays player statistics from Hypixel, a Minecraft server. I am trying to add their player's avatars as well, as a thumbnail in the embeds the bot sends. To get the avatars I am using <a href="https://crafatar.com" rel="nofollow noreferrer">Crafatar</a>. This is the code I am using, however, the thumbnail doesn't show up on the embed. I believe this has something to do with the fact that I am using an URL with a variable in it, as I tried with just a regular URL and it worked fine.</p>
  
  <pre class="lang-js prettyprint-override"><code>.setThumbnail(`https://crafatar.com/avatars/${uuid}.jpg`)
  </code></pre>
  
  <p>The variable <code>uuid</code> is declared and assigned to a value further up in my code. </p>
  
  <p><strong>EDIT 1</strong></p>
  
  <p>This is the code where I get the <code>uuid</code> variable from. I can't see anything wrong with it, however, I am not particularly skilled in JavaScript.</p>
  
  <pre class="lang-js prettyprint-override"><code>var uuid = '';
  getId(args[1]).then(id =&gt; {
    uuid = id;
  })
  </code></pre>
  
  <p><code>getId</code> is a function defined below, which looks like this:</p>
  
  <pre class="lang-js prettyprint-override"><code>function getId(playername) {
    return fetch(`https://api.mojang.com/users/profiles/minecraft/${playername}`)
      .then(data =&gt; data.json())
      .then(player =&gt; player.id);
  }
  </code></pre>
  
  <p>This uses the Mojang API to convert the player's display name, which is entered as a command parameter, to their UUID.</p>