如何计算discord.js中某个表情符号对消息的反应

如何计算discord.js中某个表情符号对消息的反应,discord.js,Discord.js,我正在创建一个poll命令,并尝试在单个表情符号上获取反应计数。当我今天早些时候查看消息时,它返回了消息数据,显示了reactions集合。但是,当我查找reactions集合时,它返回了undefined。经过大量调试和尝试后,它只返回通道中所有消息的列表 const embedMessage = await channel.messages.fetch(row.get('messageID')); //row.get(messageID) is just looking at a datab

我正在创建一个poll命令,并尝试在单个表情符号上获取反应计数。当我今天早些时候查看消息时,它返回了消息数据,显示了
reactions
集合。但是,当我查找reactions集合时,它返回了
undefined
。经过大量调试和尝试后,它只返回通道中所有消息的列表

const embedMessage = await channel.messages.fetch(row.get('messageID')); //row.get(messageID) is just looking at a database for the stored messageID, I checked and the database is storing that correctly.
const embedMessageReacts = embedMessage.reactions; //This returns 'undefined'

//I also have the original 'embed' constant cached from the original embed message sending higher in the code but it no longer shows up as anything.
//The 'channel' constant works as normal.
//Also, the collection cannot be empty as the bot itself reacts to the message I am getting. Meaning, the message already has at least 2 reactions on it (the minimum for the command to work causes there to be at least 2 reactions)
//Lastly, it is not listening for reactions (although there is a listener for when the message containing these reactions is sent), so I have to look it up manually.
//Instead, these run when a certain time has elapsed.
//Hopefully there is a solution because this issue has taken up 2 days of time.

反应不再被捕捉。
您必须在使用前捕获它们。
像这样:

if(!embedMessage){return(false);}
const embedMessageReacts=embedMessage.reactions.cache;
你可以很容易地计算表情符号

let Heart=embedMessage.reactions.cache.get('♥️').计数

谢谢,我将在今天晚些时候查看是否有效,并会通知您。