serenity
serenity copied to clipboard
Reacting with a custom emoji fails with "Unknown Emoji"
I use serenity::model::channel::Message::react() with custom emoji. But, it return following result.
Http(UnsuccessfulRequest(ErrorResponse { status_code: 400, url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("discord.com")), port: None, path: "/api/v9/channels/<channel_id>/messages/<message_id>/reactions/sob:906212321519603722/@
", query: None, fragment: None }, error: DiscordJsonError { code: 10014, message: "Unknown Emoji", errors: [] } }))
"path" is wrong?
/reactions/sob:906212321519603722/@me ×
/reactions/:sob:906212321519603722/@me◎
//__________↑ colon
"path" is wrong?
It is not. The format for custom emojis is <name>:<id>, as stated in the documentation of the endpoint. What is the input you are using for Message::react, exactly?
I'm sorry, I referenced a personal blog. I have to reference official documents.
I want to :mount_fuji:.
If I reply some messages, it succeed.
let mes = "<:mount_fuji:887301207872389122>"
let new_msg = msg.reply(ctx, mes).await?;
But, If I react to messages, it fail.
let react = "<:mount_fuji:887301207872389122>"
let reaction = ReactionType::try_from(react);
new_msg.react(ctx, r).await?;
I have tried to react both a unicode and custom emoji on a message, and they work as expected. Is <:mount_fuji:887301207872389122> actually a custom emoji, or are you just trying to react a unicode emoji (which :mount_fuji: is)?
No response for 10 months, can this be closed?