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 错误:未知表情符号 - 对嵌入做出
基础教程推荐
- jQuery File Upload - 如何识别所有文件何时上传 2022-01-01
- 如何使用 CSS 显示和隐藏 div? 2022-01-01
- 什么是不使用 jQuery 的经验技术原因? 2022-01-01
- 如何在特定日期之前获取消息? 2022-01-01
- Node.js 有没有好的索引/搜索引擎? 2022-01-01
- 为什么我在 Vue.js 中得到 ERR_CONNECTION_TIMED_OUT? 2022-01-01
- 每次设置弹出窗口的焦点 2022-01-01
- 如何使用sencha Touch2在单页中显示列表和其他标签 2022-01-01
- WatchKit 支持 html 吗?有没有像 UIWebview 这样的控制器? 2022-01-01
- Javascript 在多个元素上单击事件侦听器并获取目标 2022-01-01
