title: Put an emoji in a Discord button with my bot?
body: <p>How do I include an emoji in a button sent from my Discord bot? I'm looking to include the <code>:arrow_up:</code> emoji. I know that I can include an emoji in an embed using <code>&lt;:emojiname:emojiID&gt;</code>, but this doesn't work. For example, this code:</p>
  <pre><code>const row = new MessageActionRow()
      .addComponents(
          new MessageButton()
              .setCustomId(&quot;upvote&quot;)
              .setLabel(&quot;&lt;:arrow_up:905702018902011955&gt;&quot;)
              .setStyle(&quot;SUCCESS&quot;),
          new MessageButton()
              .setCustomId(&quot;downvote&quot;)
              .setLabel(&quot;&lt;:arrow_down:905702018902011955&gt;&quot;)
              .setStyle(&quot;DANGER&quot;)
      );
  </code></pre>
  <p>This results in buttons that simply include the string <code>&lt;:arrow_up:905702018902011955&gt;</code> text, like this:
  <a href="https://i.stack.imgur.com/4sGKA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4sGKA.png" alt="enter image description here" /></a></p>
  <p>I accidentally stumbled upon a method called <code>.setEmoji()</code>, but I've been trying different inputs and I can't seem to get it to work. It doesn't say that it's not a method, but rather I get an error:</p>
  <pre><code>DiscordAPIError: Invalid Form Body
  data.components[0].components[0].emoji.id: Invalid emoji
  </code></pre>
  <p>I'm lead to believe that there's some way to do this, but I really can't find any information on it online at all. Any help is greatly appreciated, thanks!</p>
  <p>EDIT: Also, I forgot to include, but on Discord's own developer portal I found this: <a href="https://discord.com/developers/docs/interactions/message-components#button-object-button-styles" rel="nofollow noreferrer">https://discord.com/developers/docs/interactions/message-components#button-object-button-styles</a></p>
  <p>It clearly shows an entry called &quot;Emoji button&quot;, but it's not listed in the Button Styles list, so I don't know how to actually use it? But clearly it's there or it was at one point.</p>
  <p>EDIT 2: This is my code when I use <code>.setEmoji()</code></p>
  <pre><code>const row = new MessageActionRow()
      .addComponents(
          new MessageButton()
              .setCustomId(&quot;upvote&quot;)
              .setEmoji(&quot;&lt;:arrow_up:905702018902011955&gt;&quot;)
              .setStyle(&quot;SUCCESS&quot;),
          new MessageButton()
              .setCustomId(&quot;downvote&quot;)
              .setEmoji(&quot;&lt;:arrow_down:905702018902011955&gt;&quot;)
              .setStyle(&quot;DANGER&quot;)
      );
  </code></pre>
  <p>This gives me this error:</p>
  <pre><code>DiscordAPIError: Invalid Form Body
  data.components[0].components[0].emoji.id: Invalid emoji
  data.components[0].components[1].emoji.id: Invalid emoji
  </code></pre>