#ReactionCollector discord.js reasons to stop/end

6 messages · Page 1 of 1 (latest)

hushed island
#

Hello,
I was wondering if there is any resource/documentation for all the reasons that can be emitted by discord.js when Reaction Collector is stopped and an 'end' event is emitted, as I can't find anything in the documentation nor here, I just found few 'somethingDelete' in the source in node_modules.
I removeAll() reactions on collector end, which is also triggered when the message is deleted, which causes me an Discord API error and crashes the client.

collector.on('end', async () => {
    response.reactions.removeAll();
});

Error stack: https://srcb.in/TJ9NhrE893

I partially solved it like this:

collector.on('end', async (__, reason) => {
    if (reason.endsWith('Delete')) return;
    response.reactions.removeAll();
});

But would like it to make it more proof in case there is other case.

discord.js version: 14.10.2 (same on 14.9)
node v16.14.2

Can you please point me somewhere or suggest me something if you have any ideas or encountered this issue yourself?

Thank you in advance.

timber ingotBOT
#

• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.

floral knoll
#

For ReactionCollector
messageDelete, channelDelete, threadDelete, guildDelete, limit, emojiLimit, userLimit, time, idle.

hushed island
#

Thank you very much!
May I ask where did you get this?

hushed island
#

Thank you, I didn't look into collector.js, silly me.