这是我的代码:
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 错误:未知表情符号 - 对嵌入做出反应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
discord.js v12:我如何等待 DM 频道中的消息?discord.js v12: How do I await for messages in a DM channel?(discord.js v12:我如何等待 DM 频道中的消息?)
如何让我的机器人提及发出该机器人命令的人how to make my bot mention the person who gave that bot command(如何让我的机器人提及发出该机器人命令的人)
如何修复必须使用导入来加载 ES 模块 discord.jsHow to fix Must use import to load ES Module discord.js(如何修复必须使用导入来加载 ES 模块 discord.js)
如何列出来自特定服务器的所有成员?How to list all members from a specific server?(如何列出来自特定服务器的所有成员?)
Discord bot:修复“找不到 FFMPEG"Discord bot: Fix ‘FFMPEG not found’(Discord bot:修复“找不到 FFMPEG)
使用 discord.js 加入 discord 服务器时的欢迎消息Welcome message when joining discord Server using discord.js(使用 discord.js 加入 discord 服务器时的欢迎消息)