Discord.js: ReactionCollector only collects reactions from Users that have already sent a message in the Channel.

Created on 1 Nov 2020  路  7Comments  路  Source: discordjs/discord.js

I'm setting up a ReactionCollector on a message like this:

const filter = (reaction, user) => {
    return true; 
};
const collector = msg.createReactionCollector(filter);
collector.on('collect', (reaction, user) => {
    console.log('Callback - User:' + user.id)
});

I would expect that this would print Callback - User: foo when a user with the UserID foo reacts to msg.
However, this only happens if the User has already sent a message in the Channel after msg was sent.

question (please use Discord instead) API changes

Most helpful comment

You don't need privileged intents for that, you just need to enable necessary partials in ClientOptions.

All 7 comments

Caused by API intents - #4961.

Thanks for the reply. It's not obvious to me which of my functions requires those privileges. Could you elaborate?

I also have the same issue. I don't see how that's related to privileges though . . .

You don't need privileged intents for that, you just need to enable necessary partials in ClientOptions.

I see, so I would imagine that in this particular scenario, the "REACTION" string needs to be added to the array in the partials attribute of the Client. Thanks a lot!

It would be good if you could also add a warning about this on the documentation of classes like ReactionCollector (https://discordjs.guide/popular-topics/collectors.html#reaction-collectors).

"You don't need privileged intents for that, you just need to enable necessary partials in ClientOptions."
Hi can someone tell me how I do this

"You don't need privileged intents for that, you just need to enable necessary partials in ClientOptions."
Hi can someone tell me how I do this

See the link provided by advaith above (https://discord.js.org/#/docs/main/stable/topics/partials)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

xCuzImPro picture xCuzImPro  路  3Comments

ghost picture ghost  路  3Comments

Blumlaut picture Blumlaut  路  3Comments

tom-barnes picture tom-barnes  路  3Comments

Brawaru picture Brawaru  路  3Comments