#subscribing to a thread

1 messages · Page 1 of 1 (latest)

azure rain
#

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.`);
 });
#

it will say 'collector created' and after a few minutes day 'collected 0 messages', but collect never gets triggered

#

i have bot permissions set to administrator