title: "TypeError [EMOJI_TYPE]: Emoji must be a string or GuildEmoji/ReactionEmoji" while coding Reaction Roles for a Discord Bot
body: <p>I have been following the Worn Off Keys Discord.JS guide to get to know discord.js better, even though I understand JS fairly well. I got to a problem though when coding the reaction roles. I cloned the code for a special file from the WOK Discord JS repository. I usually clone the files and then adapt them to my liking, adding and removing some parts. But this time when I ran the code to test the basic clone out, I got an error saying <code>TypeError [EMOJI_TYPE]: Emoji must be a string or GuildEmoji/ReactionEmoji</code> I couldn't find any place where I could fix this, as it worked in the tutorial video with the exact same code.</p>
  <p>Here is my code for the special reaction roles file:</p>
  <pre class="lang-js prettyprint-override"><code>const firstMessage = require('./first-message')
  
  module.exports = (client) =&gt; {
      const channelId = '870818745109585920'
  
      const getEmoji = (emojiName) =&gt; client.emojis.cache.find((emoji) =&gt; emoji.name === emojiName)
  
      const emojis = {
          red_circle: 'CrackShot / Sniper',
          orange_circle: 'Scrambler / Shotgun',
          yellow_circle: 'Whipper / P90',
          green_circle: 'RPEGG / RPG',
          blue_circle: 'Free Ranger / Semi-Auto',
          purple_circle: 'EGG-K / AK-47',
          white_circle: 'TriHard / AUG',
          black_circle: 'Cluck-9mm / Pistol'
      }
  
      const reactions = []
  
      let emojiText = '**GUN ROLES**\n\n'
      for (const key in emojis) {
          const emoji = getEmoji(key)
          reactions.push(emoji)
  
          const role = emojis[key]
          emojiText += `${emoji} = ${role}\n`
      }
  
      firstMessage(client, channelId, emojiText, reactions)
  
      const handleReaction = (reaction, user, add) =&gt; {
          if (user.id === '869698265698947102') {
              return
          }
          const emoji = reaction._emoji.name
  
          const { guild } = reaction.message
  
          const roleName = emojis[emoji]
          if(!roleName) {
              return
          }
  
          const role = guild.roles.cache.find((role) =&gt; role.name === roleName)
          const member = guild.members.cache.find((member) =&gt; member.id === user.id)
  
          if (add) {
              member.roles.add(role)
          } else {
              member.roles.remove(role)
          }
      }
  
      client.on('messageReactionAdd', (reaction, user) =&gt; {
          if (reaction.message.channel.id === channelId) {
              handleReaction(reaction, user, true)
          }
      })
  
      client.on('messageReactionRemove', (reaction, user) =&gt; {
          if (reaction.message.channel.id === channelId) {
              handleReaction(reaction, user, false)
          }
      })
  }
  </code></pre>
  <p>The <code>first-message</code> file that you see there is:</p>
  <pre class="lang-js prettyprint-override"><code>const addReactions = (message, reactions) =&gt; {
      message.react(reactions[0])
      reactions.shift()
      if (reactions.length &gt; 0) {
          setTimeout(() =&gt; addReactions(message, reactions), 750)
      }
  }
  
  module.exports = async (client, id, text, reactions = []) =&gt; {
      const channel = await client.channels.fetch(id)
  
      channel.messages.fetch().then((messages) =&gt; {
          if (messages.size === 0) {
              channel.send(text).then((message) =&gt; {
                  addReactions(message, reactions)
              })
          } else {
              for (const message of messages) {
                  message[1].edit(text)
                  addReactions(message[1], reactions)
              }
          }
      })
  }
  </code></pre>
  <p>And all I added from those files to the main <code>index.js</code> file is <code>const roleClaim = require('./role-claim')</code> and later inside the <code>client.on(ready)</code>etc. part I added     <code>roleClaim(client)</code> to run the bot code. Any suggestions? Sorry for the giant amounts of text. Please help.</p>