相关疑难解决方法(0)

使用 discord.js 收集对消息做出反应的用户

我正在尝试收集对某些消息做出反应的所有用户。我的代码

client.on('messageReactionAdd', (reaction, user) => {
    if(reaction.emoji.name === "?") {
    console.log(reaction.emoji.users);
}
Run Code Online (Sandbox Code Playgroud)

但它返回未定义。如果我使用“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: '?',
Run Code Online (Sandbox Code Playgroud)

我正在努力争取这users: Collection …

javascript node.js discord discord.js

6
推荐指数
1
解决办法
3万
查看次数

标签 统计

discord ×1

discord.js ×1

javascript ×1

node.js ×1