reaction.emoji.name returns 一个 unicode 字符串,如何检查某些内容是否与该 unicode 匹配?

reaction.emoji.name returns a unicode string, how to check if something matches that unicode?

我正在使用 Discord.js 作为 discord 机器人,我正在尝试制作右舷功能,但我寻求帮助,他们给了我 reaction.emoji.name 并说 returns unicode 字符串,我不确定如何检查反应是否是特定的 unicode 字符。

我的代码:

我正在使用图像,因为反引号不起作用并且声称我的代码格式不正确。抱歉给您带来不便。

要将默认表情符号与字符串进行比较,请找到 unicode 表情符号并使用它。

进入 discord 并输入你想要比较的表情符号。用 \ 开头:

复制生成的第二个表情符号(尺寸较小,颜色通常不同)。像这样将其插入您的代码中:

或原始代码:

if (reaction.emoji.name === '⭐')
{