kord-extensions icon indicating copy to clipboard operation
kord-extensions copied to clipboard

Emoji converter doesn't work with custom emojis

Open zt64 opened this issue 1 year ago • 3 comments

Description

Emoji converter throws not found error for all custom emojis.

image

Versions

Kord Extensions: 1.5.5-SNAPSHOT

Reproduction

val emoji by emoji {
    name = "emoji"
    description = "The emoji"
}

zt64 avatar Sep 23 '22 20:09 zt64

Hello, and thanks for opening an issue! As this is the first time you've created an issue on this repository, we'd just like to offer you a warm welcome to the project, and the following pointers:

  • Most importantly, all issues must adhere to our Code of Conduct. Please give it a quick read if you haven't already.

  • While our team is passionate about the projects we've created here, we're all volunteers. Please don't be offended if it takes time for us to get to your issue - we'll be here as soonas we can be!

  • Please provide as much information as possible when asking a question, reporting a problem, or submitting a feature request. This will help us to address your issue quickly and efficiently. If you forgot to add some information, no worries - feel free to edit the issue and add anything you missed!

    Thanks for contacting us! If you have any further questions, please feel free to join us on Discord in the #dev-kotdis channel (or #kordex-discussion for Kord Extensions projects), or to contact a staff member directly.

boring-cyborg[bot] avatar Sep 23 '22 20:09 boring-cyborg[bot]

The code appears as if it should work as intended, but I can see Kord's caching potentially getting in the way. Still, please check the following:

  • That you have the necessary intents to see guild emoji
  • That you're using an emoji that exists on a guild the bot is present on
  • If that doesn't help, that the bot has permission to manage emojis on the server

If none of these things help, report back and let me know.

Additionally, it's possible that this converter isn't actually all that useful in the long run - maybe it should return some other type? I'm not sure how best to change it, because you need a guild ID in order to grab a GuildEmoji object. It's possible that Kord hasn't implemented the logic to make this kind of converter realistic.

gdude2002 avatar Sep 25 '22 09:09 gdude2002

Turns out adding the Intent.GuildEmojis fixed it. Maybe there should be documentation added to the emoji that says it will need that intent.

zt64 avatar Sep 25 '22 19:09 zt64

This has been documented in the new KordEx docs. I've also added a note to the KDoc for the emoji converter, although I realise it's unlikely anyone actually reads those.

As an update on this converter in general, I figured I'd also mention that the emoji converter can now handle Unicode emoji names as defined by Discord, and KordEx now provides JEmoji as an API dependency for this purpose.

gdude2002 avatar Feb 28 '24 10:02 gdude2002

Thank you

zt64 avatar Feb 28 '24 15:02 zt64