kordlib / kord

Idiomatic Kotlin Wrapper for The Discord API
MIT License
931 stars 82 forks source link

ReactionEmoji.Unicode - poorly documented #615

Open deanveloper opened 2 years ago

deanveloper commented 2 years ago

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 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:

  1. Change name to something else
  2. Add KDoc
  3. Do some basic validation, ie if (name.all { it.isLetterOrDigit }) and throw a descriptive error
DRSchlaubi commented 2 years ago

I am quite sure name is just how discord calls this, but we can add some kdoc

DRSchlaubi commented 1 year ago

Also fyi there is kordx.emoji