trying to create a voice channel in a parent category
I'm trying to make a slash command that when used will create a voice chat and then delete it when everyone leaves.
this works fine when creating a channel with no parent category
but when I check if there is a parent it creates the channel on the "root" level..
what am I missing
Ideally I would like to use the command in a thread such as this and have it create a voice channel at the top of the category.
my test env is not setup for threads but I want it to be in the category of the threads, not in the thread.
for instance this category is called DISCORD.JS SUPPORT create a voice channel in the category
"node": "20.16.0"
"discord.js": "^14.15.3",
5 Replies
- 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 OP1) thats not valid js syntax, looks like your code got cut off
2) you are getting the parent but still calling <Guild>.channels.create so it indeed will create it at the root level
either pass in the id or call create on the children
thank you
returns
in the ide
and wont compile out.
channel.parent is returning type 'CategoryChannel | NewsChannel | TextChannel | ForumChannel | MediaChannel' and not ChannelType.GuildCategory is there a typings that im missing?
you need to compare it
thank you both thats what i was missing
parent: category as CategoryChannel