Detect reactions

Hi, I'm trying to simply detect when any reaction has been added to any message. How can I do that?
My end goal is to then check if it's in a certain channel before I store it temporarily, so if there's another way to do that that's also fine.
I've tried using this code on Collectors just to get started understanding them from https://discordjs.guide/popular-topics/collectors.html#message-collectors but it seems like it needs to be in a command, which i'm not sure where in a command it would be since commands have a short life span and this is a more long (2 day) active thing.
// `m` is a message object that will be passed through the filter function
const collectorFilter = m => m.content.includes('discord');
const collector = interaction.channel.createMessageCollector({ filter: collectorFilter, time: 15_000 });

collector.on('collect', m => {
    console.log(`Collected ${m.content}`);
});

collector.on('end', collected => {
    console.log(`Collected ${collected.size} items`);
});



Any help appreciated! šŸ™‚
Imagine a guide... that explores the many possibilities for your discord.js bot.
Was this page helpful?