2017-10-22 1 views
0

特定のメッセージに反応したすべてのユーザーを収集しようとしています。 マイコードdiscord.jsを使用してメッセージに反応したユーザーを収集する

client.on('messageReactionAdd', (reaction, user) => { 
    if(reaction.emoji.name === "✅") { 
    console.log(reaction.emoji.users); 
} 

しかし、それは未定義を返します。私が使用している場合は、「reaction.emojiは、」それは私がusers: Collection { '370300235030986752' => [Object] },一部を取得しようとしている

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: '✅', 

を返します。前もって感謝します。

答えて

0

docsによると、それだけでreaction.users次のとおりです。

client.on('messageReactionAdd', (reaction, user) => { 
    if(reaction.emoji.name === "✅") { 
     console.log(reaction.users); 
    } 
}); 
+0

感謝。何らかの理由で私はそれは反応だったけれど。emoji.users。 – Maze

関連する問題