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
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.
Access a channel and head to the chat with messages you wish to check. Select a message and long-press on a reaction. This will open a new page that will reveal the people who have interacted with the text and their reactions.
In the search bar add has:reaction so you can quickly find messages that have been reacted to.
Discord uses a special syntax to embed mentions in a message. For user mentions, it is the user's ID with <@ at the start and > at the end, like this: <@86890631690977280> . If they have a nickname, there will also be a ! after the @ .
According to the docs it is just reaction.users
:
client.on('messageReactionAdd', (reaction, user) => {
if(reaction.emoji.name === "✅") {
console.log(reaction.users);
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With