Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReactionEmoji.Unicode - poorly documented #615

Open
deanveloper opened this issue Jun 7, 2022 · 2 comments
Open

ReactionEmoji.Unicode - poorly documented #615

deanveloper opened this issue Jun 7, 2022 · 2 comments

Comments

@deanveloper
Copy link

public data class Unicode(override val name: String) : ReactionEmoji() {

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
Copy link
Member

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

@DRSchlaubi
Copy link
Member

DRSchlaubi commented Jun 15, 2023

Also fyi there is kordx.emoji

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants