async execute(interaction) {
await interaction.deferReply({ ephemeral: true });
const guild = interaction.guild;
try {
const inputChannel = await interaction.options.getChannel('channel');
// Get the active threads
let channel = await inputChannel.threads.fetch();
// Get the archived threads
let archived = await inputChannel.threads.fetchArchived();
let posts = [];
archived.threads.forEach(async post => {
posts.push(post);
})
console.log(posts.length);
}
catch(e) {
console.log(e);
await interaction.editReply({content: `Something went wrong while processing the interaction`});
}
}
async execute(interaction) {
await interaction.deferReply({ ephemeral: true });
const guild = interaction.guild;
try {
const inputChannel = await interaction.options.getChannel('channel');
// Get the active threads
let channel = await inputChannel.threads.fetch();
// Get the archived threads
let archived = await inputChannel.threads.fetchArchived();
let posts = [];
archived.threads.forEach(async post => {
posts.push(post);
})
console.log(posts.length);
}
catch(e) {
console.log(e);
await interaction.editReply({content: `Something went wrong while processing the interaction`});
}
}