Discord.js DiscordAPI Error: Unknown Emoji - Reacting to an Embed(Discord.js DiscordAPI 错误:未知表情符号 - 对嵌入做出反应)
问题描述
这是我的代码:
client.on('message', message => {
if (message.content.startsWith("!embed")) {
const embed = new Discord.MessageEmbed()
.setColor(0xffffff)
.setFooter(`Page 1`)
message.channel.send(':rewind::fast_forward:'); //this works
//but this doesn't
message.channel.send(embed).then(embedMessage => {
embedMessage.react(":rewind:");
});
});
我可能有一个隐藏的问题或没有提供正确的参数.我查看了 类似的先前提出的问题 并尝试实现它,但它没用,可能已经过时了.
I may have a hidden issue or not provided the correct parameters. I have looked at a similar previously asked question and tried implementing it, but it didn't work, may be outdated.
相反,我收到一个错误:
Instead, I receive an error:
UnhandledPromiseRejectionWarning: DiscordAPIError: Unknown Emoji
我使用的表情符号在标准表情符号库中提供,:rewind:
The emoji I'm using is provided in the standard emoji library, :rewind:
推荐答案
Discord.Js 不处理带有 Discord 用户端 :rewind:
内容的表情符号.Discord.js 使用 unicode 来发送和接收表情符号,除了自定义表情符号,这里使用 ID.
Discord.Js does not handle emojis with the Discord User Side :rewind:
stuff. Discord.js is using unicode to send and receive emojis, except for custom emojis, IDs are used there instead.
这意味着您应该改用以下代码.
This means that you should use the following code instead.
embedMessage.react("⏪");
Unicode 表情符号可以通过转义"找到.Discord 中的表情符号或使用类似:https://getemoji.com/.
The Unicode emojis can be found by "escaping" the emoji in Discord or using something like: https://getemoji.com/.
转义是通过在表情符号前面使用来实现的,你可能从
中知道这一点.通过输入 :rewind:
,结果将如下所示.
The escaping works by using in front of the emoji, you might know this from
. By putting :rewind:
the result will look as follows.
复制 Unicode 表情符号时,请确保删除其中的所有空格.
When copying the Unicode emoji make sure to delete any spaces off of it.
这篇关于Discord.js DiscordAPI 错误:未知表情符号 - 对嵌入做出反应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Discord.js DiscordAPI 错误:未知表情符号 - 对嵌入做出


- Quasar 2+Apollo:错误:找不到ID为默认的Apollo客户端。如果您在组件设置之外,请使用ProvideApolloClient() 2022-01-01
- CSS媒体查询(最大高度)不起作用,但为什么? 2022-01-01
- addEventListener 在 IE 11 中不起作用 2022-01-01
- 失败的 Canvas 360 jquery 插件 2022-01-01
- Css:将嵌套元素定位在父元素边界之外一点 2022-09-07
- Flexslider 箭头未正确显示 2022-01-01
- 使用RSelum从网站(报纸档案)中抓取多个网页 2022-09-06
- 如何使用 JSON 格式的 jQuery AJAX 从 .cfm 页面输出查 2022-01-01
- Fetch API 如何获取响应体? 2022-01-01
- 400或500级别的HTTP响应 2022-01-01