ReactionCollector discord.js reasons to stop/end

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();
});
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();
});
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.
5 Replies
d.js toolkit
d.js toolkit14mo ago
• 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.
Syjalo
Syjalo14mo ago
For ReactionCollector messageDelete, channelDelete, threadDelete, guildDelete, limit, emojiLimit, userLimit, time, idle.
Tomáš
Tomáš14mo ago
Thank you very much! May I ask where did you get this?
Tomáš
Tomáš14mo ago
Thank you, I didn't look into collector.js, silly me. Have a beautiful day