async function listForumThreads (channelId: string, since?: Date) {
const client = await getClient();
const channel = client.channels.cache.get(channelId) as Channel;
if (channel?.type === ChannelType.GuildForum) {
console.log('Channel:', channel.name);
console.log('Topic:', channel.topic);
const channelForum = channel as ForumChannel;
const fetchedThreads = await channelForum.threads.fetch(undefined, { cache: false });
let idx = 0;
console.log('XX', fetchedThreads.threads.entries.length);
fetchedThreads.threads.forEach(message => {;
console.log(idx++, message.toJSON());
});
}
process.exit(1);
}
async function listForumThreads (channelId: string, since?: Date) {
const client = await getClient();
const channel = client.channels.cache.get(channelId) as Channel;
if (channel?.type === ChannelType.GuildForum) {
console.log('Channel:', channel.name);
console.log('Topic:', channel.topic);
const channelForum = channel as ForumChannel;
const fetchedThreads = await channelForum.threads.fetch(undefined, { cache: false });
let idx = 0;
console.log('XX', fetchedThreads.threads.entries.length);
fetchedThreads.threads.forEach(message => {;
console.log(idx++, message.toJSON());
});
}
process.exit(1);
}