如何在Discord.JS中删除特定类别中的所有频道? 我尝试过
oldMember.guild.channels.cache.get(client.tr["Settings"].MainChannelID).parent.channels.cache.forEach(c => {
if(c.members.size != 0){
c.delete();
}
})
答案 0 :(得分:1)
const category = await oldMember.guild.channels.cache.get(CATEGORY_ID); // You can use `find` instead of `get` to fetch the category using a name: `find(cat => cat.name === 'test')
category.children.forEach(channel => channel.delete())