serenity icon indicating copy to clipboard operation
serenity copied to clipboard

Reacting with a custom emoji fails with "Unknown Emoji"

Open crssnky opened this issue 4 years ago • 3 comments

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

crssnky avatar Nov 05 '21 16:11 crssnky

"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?

arqunis avatar Nov 05 '21 16:11 arqunis

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?;

crssnky avatar Nov 06 '21 02:11 crssnky

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)?

arqunis avatar Nov 07 '21 09:11 arqunis

No response for 10 months, can this be closed?

kangalio avatar Sep 12 '22 09:09 kangalio