title: Discord bot doesn't show emotes from other servers in embeds
body: <p>I'm working on a Discord bot using <a href="https://github.com/discord-net/Discord.Net" rel="nofollow noreferrer">Discord.Net 2.2.0</a> and written in VB.NET. One of the (<em>overly-ambitious?</em>) many features of my bot will be posting player data from the mobile game, <em>Star Wars: Galaxy of Heroes</em> into an embed. This includes certain character ability information in which I wish to include some emotes to make it a bit more aesthetically pleasing. Initially, I had uploaded the emotes to a server I was testing in and everything worked great:</p>
  <p><a href="https://i.stack.imgur.com/gQqDQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gQqDQ.png" alt="Embed with emotes loaded from only the client/target server" /></a></p>
  <p>However, I realized that, if my bot makes it out into the wild, I can't really be installing these emotes on every server out there. I'm still in the beginning stages of this project, and I foresee the need for several &quot;custom&quot; emotes for some of the embeds I'll be using. So, I decided to create a new Discord server (<em>henceforth referred to as the bot's &quot;home&quot; server</em>) in which to load these emotes for use in the &quot;client&quot; or &quot;target&quot; server.</p>
  <p>Unfortunately, when I try to include emotes from the bot's home server in the embed, all I get are the emote names and no images:</p>
  <p><a href="https://i.stack.imgur.com/R5g6e.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/R5g6e.png" alt="Embed with emotes loaded from only the home server" /></a></p>
  <p>After fighting with it a bit, I tried including emotes from both servers in the same embed and I get &quot;mixed&quot; results. Those emotes that I include which are loaded in the client/target server show up correctly, but those that are from the bot's home server only display the emote name:</p>
  <p><a href="https://i.stack.imgur.com/VOwBZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VOwBZ.png" alt="Embed with emotes loaded from both home and client/target server" /></a></p>
  <p>The method is pretty long, so here's a <em>very</em> simplified example of the code I'm using to create the embeds:</p>
  <pre class="lang-vb prettyprint-override"><code>Dim BotHomeServer As Discord.WebSocket.SocketGuild = BotClient.GetGuild(Convert.ToUInt64(HOME_SERVER_ID))
  Dim TargetServer As Discord.WebSocket.SocketGuild = BotClient.GetGuild(Convert.ToUInt64(TARGET_SERVER_ID))
  Dim PostingChannel As Discord.WebSocket.SocketTextChannel = TargetServer.GetTextChannel(Convert.ToUInt64(POST_CHANNEL_ID))
  Dim HomeEmote As Discord.Emote = Await BotHomeServer.GetEmoteAsync(EMOTE_ID_FROM_HOME_SERVER)
  Dim TargetEmote As Discord.Emote = Await TargetServer.GetEmoteAsync(EMOTE_ID_FROM_TARGET_SERVER)
  Dim PostBuilder As New Discord.EmbedBuilder
  
    '... other fields and properties of the embed
  PostBuilder.AddField(&quot;Home Server Test&quot;, &quot;Some Text Here &lt;:&quot; &amp; HomeEmote.Name &amp; &quot;:&quot; &amp; HomeEmote.Id &amp; &quot;&gt;&quot;, False)
  PostBuilder.AddField(&quot;Target Server Test&quot;, &quot;Some Text Here &lt;:&quot; &amp; TargetEmote.Name &amp; &quot;:&quot; &amp; TargetEmote.Id &amp; &quot;&gt;&quot;, False)
    '... other fields and properties of the embed
  
  Await PostingChannel.SendMessageAsync(&quot;This is a test&quot;, False, PostBuilder.Build)
  </code></pre>
  <p>I've also tried using the <code>.ToString()</code> method for adding the emotes to the embed instead of &quot;manually&quot; building them with the <code>Name</code> and <code>Id</code> properties, but I get the exact same results. I retrieved the emote ID's by typing <code>\:emotename:</code> in the home (and client/target) server. The emote names (i.e., <code>:gohomega:</code>) are correct, so I know that it's correctly finding the emote in the bot's home server. It's just not displaying them unless they're loaded in the client/target server.</p>
  <p>I found a <em>similar</em> issue addressed in the question, <a href="https://stackoverflow.com/questions/45263865/discord-bot-cant-show-emote-sometimes">Discord bot can't show emote “sometimes”</a>. Although the issue reported there is definitely different, the end result - the emote names showing up instead of the actual image - is the same behavior I'm trying to troubleshoot. The fact that the issue in that question is sporadic (whereas my issue is consistent) and that the bot there is written in a different language (Node.js instead of a .NET language) and using different libraries (I assume) has me wondering if the issue may be on Discord's end rather than anything to do with my code.</p>
  <p>I've triple- and quadruple-checked that the bot (and the role group it's in) have permission to use external emojis on the client/target server:</p>
  <p><a href="https://i.stack.imgur.com/eLAaL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eLAaL.png" alt="Target server permission settings for bot role" /></a></p>
  <p>Initially, I had forgotten this bit and it didn't have the appropriate permissions. However, even after granting the necessary permissions, I still get the same results.</p>
  <p>At this point, I'm not above admitting that I may just be overlooking/missing something, or simply being dense about what I'm looking at, but I'm wondering if anyone else has encountered (and hopefully resolved) this particular issue with a bot using emotes from a different server.</p>
  <hr />
  <h2>EDIT</h2>
  <p>Just to make certain, I stepped through the code in my IDE and checked the properties of one of the emotes at the time it's supposedly being added to the embed:</p>
  <p><a href="https://i.stack.imgur.com/ucR0z.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ucR0z.png" alt="Emote object definition at runtime" /></a></p>
  <p>The emote's <code>Id</code> and <code>Url</code> properties appear to be correct, but I also went ahead and &quot;validated&quot; the <code>Url</code> property with my browser and verified that it does show the correct image for the emote.</p>
  <p>Per the comments, the bot <em>is</em> a member of both servers:</p>
  <p><a href="https://i.stack.imgur.com/JGRK9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JGRK9.png" alt="Membership listings for each server" /></a></p>
  <p>I'm grasping at straws here, but perhaps it has something to do with the fact that the &quot;home&quot; server is so new (I just created it last night)? I mean, Discord's documentation says this should work, and the Discord.Net documentation basically says the same thing. According to the comments, it works for other people and my code <em>looks</em> &quot;right&quot;, so it's really leading me to believe the entire issue is something on Discord's end.</p>
  <p>I've also asked this question in both the <strong><a href="https://discord.gg/discord-api" rel="nofollow noreferrer">Discord API</a></strong> server (<code>#dotnet_discord-net</code>) and the <strong><a href="https://discord.gg/0cDvIgU2voWn4BaD" rel="nofollow noreferrer">Discord Bots</a></strong> server (<code>#development</code>), so feel free to join me in one of those servers for an &quot;extended conversation&quot;, if needed.</p>