gpt4 book ai didi

javascript - 使用 discord.js 收集对消息使用react的用户

转载 作者:行者123 更新时间:2023-11-29 17:48:15 25 4
gpt4 key购买 nike

我正在尝试收集对特定消息使用react的所有用户。我的代码

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

但它返回未定义。如果我使用“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: '✅',

我正在尝试获取 users: Collection { '370300235030986752' => [Object] }, 部分。提前致谢。

最佳答案

根据docs它只是 reaction.users:

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

关于javascript - 使用 discord.js 收集对消息使用react的用户,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46877312/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com