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 toolkit14mo 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/luna14mo ago
compare the type with the ChannelType enum
Bobjoerules
BobjoerulesOP14mo ago
channel.type === 4
treble/luna
treble/luna14mo ago
use the enum
Bobjoerules
BobjoerulesOP14mo ago
for catagory
treble/luna
treble/luna14mo ago
that way you dont have to ask that question
Bobjoerules
BobjoerulesOP14mo ago
It is this which i crorrected wrongly because i thought i said it wrong
Want results from more Discord servers?
Add your server