How to access older posts in a forum channel?

Here is my current code:
async function countNewGallery(client) {
const galleryForum = (await (await client.guilds.fetch(guildID)).channels.fetch(galleryChannelID));
const options = { "limit":100, "cache":true};
const threads = (await galleryForum.threads.fetch(options)).threads;
console.log(threads.size);
}
async function countNewGallery(client) {
const galleryForum = (await (await client.guilds.fetch(guildID)).channels.fetch(galleryChannelID));
const options = { "limit":100, "cache":true};
const threads = (await galleryForum.threads.fetch(options)).threads;
console.log(threads.size);
}
For whatever reason, it is only grabbing the last 42 forum posts, but I want to go beyond the "older posts" point.
4 Replies
d.js toolkit
d.js toolkit7mo 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! - Marked as resolved by OP
ProphecyOak
ProphecyOakOP7mo ago
No description
ProphecyOak
ProphecyOakOP7mo ago
splits up the posts in the relevant forum channel and my fetch doesnt go past it
Syjalo
Syjalo7mo ago
Add archived: true option or use .fetchArchived()
Want results from more Discord servers?
Add your server