Open BlueRikoroo opened 1 year ago
It seems Discord requires you to use their own proprietary emoji name list for the tags. This emoji name list is not exposed anywhere so it cannot be used by the library. Your example works with the emoji library because the names just so happened to be shared.
I think this is something that Discord should either fix or document better because as it stands right now there's no good way to fix this on my end.
It seems Discord requires you to use their own proprietary emoji name list for the tags. This emoji name list is not exposed anywhere so it cannot be used by the library. Your example works with the emoji library because the names just so happened to be shared.
I think this is something that Discord should either fix or document better because as it stands right now there's no good way to fix this on my end.
I completely agree. It appears the only way to truely fix this currently would be to manually go through each of the emoji on the discord client and get their name
While not impossible, it is extremely tedious and I don't expect anyone to do that any time soon.
It's been done before and there are various lists doing this, however it's not something I want to include the library due to bloat and difficulty in keeping it up to date.
As a minor plug for one of said lists- https://gist.github.com/Vexs/629488c4bb4126ad2a9909309ed6bd71
Summary
Emojis added to stickers upon creation don't seem to work
Reproduction Steps
commands.Bot()
guild.create_sticker
guildSticker.edit(emoji="š")
Minimal Reproducible Code
Expected Results
Emoji should be added / edited onto the sticker in the "Related Emoji" slot when checking the sticker in the stickers section of the guild.
Actual Results
The "Related Emoji" slot is left blank (or otherwise unchanged)
Intents
discord.Intentes.all()
System Information
Checklist
Additional Context
In both discord.Guild.create_sticker and discord.GuildSticker.edit, these lines exist: discord.Guild.create_sticker discord.GuildSticker.edit
Using my input, "š", you get "OK_HAND_SIGN". Thus, the code itself does not have an error.
It then adds that emoji to the 'tags' discord.Guild.create_sticker discord.GuildSticker.edit
This seems fine as well. Checking https://discord.com/developers/docs/resources/sticker#create-guild-sticker also supports this to my knowledge.
I did find out using
emoji="ok_hand"
does work! Thus it seems to be an issue with changing it from emoji to name. I believe there is an inconsistency between whatunicodedata.name(emoji)
outputs and what discord expectsThe following code when replacing the try and except above fixed it for me: emoji
Emoji.demojize("š")
outputs":OK_hand:"
, removing the first and last character + lowering matches discords style. Not sure how true this is for other emojis. Unfortunatly doingEmoji.emojize(":" + GuildSticker.emoji + ":")
does not return "š" due to :ok_hand: being different from :OK_hand: If you want the unicode from GuildSticker.emoji, I created some code for thatAgain, I can not confirm if thise works for 100% of discord Emojis Hopefully that helps someone :D