looks like you guys are busy, but i have a question that could use some help. my bot creates a thread, and i want the bot to reply to messages put in the thread. i am saving the list of threads for when i restart the app and subscribing again on load, but thats neither here / there
what i am doing is basically this:
const thread = await client.channels.fetch(knownThread.id);
if (!(thread instanceof ThreadChannel)) {
console.log(`Channel ${thread.id} is not a thread.`);
return;
}
const collector = thread.createMessageCollector({time: 15000, max: 15});
console.log('collector created')
collector.on('collect', async (reply) => {
console.log(`New reply: ${reply.content}`);
thread.send(`Thank you for your reply, ${reply.author.username}!`);
});
collector.on('end', (collected) => {
console.log(`Collected ${collected.size} messages.`);
});