[英]Collecting users who reacted to a message using discord.js
I'm trying to collect all users that have reacted to certain message. 我正在尝试收集对某些消息做出反应的所有用户。 My code 我的代码
client.on('messageReactionAdd', (reaction, user) => {
if(reaction.emoji.name === "✅") {
console.log(reaction.emoji.users);
}
But it returns undefined. 但它返回undefined。 If I use "reaction.emoji" it returns 如果我使用“reaction.emoji”它会返回
ReactionEmoji {
reaction:
MessageReaction {
message:
Message {
channel: [Object],
id: '371695165498458115',
type: 'DEFAULT',
content: 'bb',
author: [Object],
member: [Object],
pinned: false,
tts: false,
nonce: '371695172469129216',
system: false,
embeds: [],
attachments: Collection {},
createdTimestamp: 1508689433217,
editedTimestamp: null,
reactions: [Object],
mentions: [Object],
webhookID: null,
hit: null,
_edits: [] },
me: true,
count: 1,
users: Collection { '370300235030986752' => [Object] },
_emoji: [Circular] },
name: '✅',
I'm trying to get the users: Collection { '370300235030986752' => [Object] },
part. 我正在尝试获取users: Collection { '370300235030986752' => [Object] },
部分。 Thanks in advance. 提前致谢。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.