Help with collection filter

I am trying to filter out threads which has been locked or archived, but it just return the whole collection back.
const forum = await client.channels.fetch(channel);
let threads = forum.threads.cache;
...
let fetchedThreads = threads;
do {
fetchedThreads = (await forum.threads.fetchArchived({before: fetchedThreads.last(), limit: 100})).threads;
} while ( fetchedThreads && fetchedThreads.size != 0 )
threads = forum.threads.cache.filter(thread => thread.locked == false && thread.archived == false);
const forum = await client.channels.fetch(channel);
let threads = forum.threads.cache;
...
let fetchedThreads = threads;
do {
fetchedThreads = (await forum.threads.fetchArchived({before: fetchedThreads.last(), limit: 100})).threads;
} while ( fetchedThreads && fetchedThreads.size != 0 )
threads = forum.threads.cache.filter(thread => thread.locked == false && thread.archived == false);
1 Reply
d.js toolkit
d.js toolkit17mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
Want results from more Discord servers?
Add your server