javascript 使用 discord.js 收集对消息做出反应的用户
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/46877312/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Collecting users who reacted to a message using discord.js
提问by Maze
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. 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. Thanks in advance.
我正在努力争取这users: Collection { '370300235030986752' => [Object] },部分。提前致谢。

