check to see if new channel is a category or a text channel

is there away to see if the new channel is a category or text channel and only do something if so?
client.on("channelCreate", async (channel) => {}
client.on("channelCreate", async (channel) => {}
7 Replies
d.js toolkit
d.js toolkit8mo 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
treble/luna
treble/luna8mo ago
compare the type with the ChannelType enum
Bobjoerules
Bobjoerules8mo ago
channel.type === 4
treble/luna
treble/luna8mo ago
use the enum
Bobjoerules
Bobjoerules8mo ago
for catagory
treble/luna
treble/luna8mo ago
that way you dont have to ask that question
Bobjoerules
Bobjoerules8mo ago
It is this which i crorrected wrongly because i thought i said it wrong