Deleting all channels in a category

The following code gives the error 'channel.children.forEach is not a function. I have verified that channel.children is a CategoryChannelChildManager object
channel.children.forEach(async (voice_channel) => {
await voice_channel.delete();
});
channel.children.forEach(async (voice_channel) => {
await voice_channel.delete();
});
2 Replies
d.js toolkit
d.js toolkit2y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
Squid
Squid2y ago
Managers do not have a forEach, but their .cache does
Want results from more Discord servers?
Add your server