I know 2 people now who have been fooled by this, mainly because the parameter to Unicode is name, which implies that airplane should be put in instead of ✈️. However, the discord API (and kord by transitivity) expects ✈️. It's not intuitive because basically the entire rest of discord uses names for emojis, but reactions use raw emojis.
Solutions:
Change name to something else
Add KDoc
Do some basic validation, ie if (name.all { it.isLetterOrDigit }) and throw a descriptive error
https://github.com/kordlib/kord/blob/a2912ab530d0b394d1a31a3014b91a228ec70fdc/core/src/main/kotlin/entity/ReactionEmoji.kt#L32
I know 2 people now who have been fooled by this, mainly because the parameter to
Unicode
isname
, which implies thatairplane
should be put in instead of✈️
. However, the discord API (and kord by transitivity) expects✈️
. It's not intuitive because basically the entire rest of discord uses names for emojis, but reactions use raw emojis.Solutions:
name
to something elseif (name.all { it.isLetterOrDigit })
and throw a descriptive error