简体   繁体   English

使用discord.js收集对邮件作出反应的用户

[英]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. 提前致谢。

According to the docs it is just reaction.users : 根据文档,它只是reaction.users

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Discord.js - 获取对消息做出反应的用户列表,并根据他们的反应为他们分配角色 - Discord.js - Get list of Users who reacted to a Message and assign them roles depending on their reaction 我想列出对 Discord 做出反应的用户。 对于 Discord.js - I want to list the users who have reacted to Discord. for Discord.js Discord.js v12 如何获取对特定消息做出反应的人的 ID? - Discord.js v12 How to get the id of a person who reacted on a specific message? 获取在 Discord 中对带有特定表情符号的消息做出反应的用户对象列表 - Get list of objects of users who reacted to a message with certain emoji in Discord 你如何创建一个反应收集器,它可以 output 做出反应的用户的名称并将它们保存在 discord.js 中? - How do you create a reaction collecter which can output the names of users who reacted and save them in discord.js? 是否有 function 来检查是否有人对消息做出反应? (discord.js) - Is there an function to check if someone reacted on a message? (discord.js) Discord.js:禁止对带有表情符号的消息做出反应的用户 - Discord.js: ban user that reacted to a message with emoji 向对消息 discrod js 做出反应的用户发送消息 - Send message to users who reacted to a message discrod js 获取第一个反应的用户 discord.js - get user that reacted first discord.js 获取所有对消息做出反应的用户(discord.js) - Get all users who have added a reaction to a message (discord.js)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM