Skip to content

The Emoji Problem

Juan Pablo Garcia edited this page Jul 16, 2021 · 1 revision

You might have noticed Discord.js has two different kinds of emojis:

  1. GuildEmoji
  2. ReactionEmoji

And we can also use String emojis as Unicode values.

In terms of use cases:

  • GuildEmojis or ReactionEmojis are returned by the Discord.js API when you use a Prompt class or you grab an emoji from a message.
  • String emojis are used by us developers to hard code emojis to things like features

The problem with all of this is that, before, we only used Unicode, hard coded, emojis, but with the addition of the Prompt package, we are starting to shift towards GuildEmojis and ReactioNEmojis. Having said that, use for Unicode emojis will always exist, so you need to account for either of them to be used!

To this end the Feature class, which uses an emoji has a special static create() function that can handle any kind of emoji type and create a Feature with the correct information!

To view this static function see it here.

Clone this wiki locally