Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

333
Views
Does anyone know how to create and delete a category with channels in Discord.js?

I am trying to get my discord bot to create a category that has 3 distinct channels, each with different permissions. I would also like a way to delete this category entirely at the end of my code. Any idea on how to do it?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

There are multiple ways to do it. Here are 3 of them:

Putting parent in channel create options:

guild.channels.create("chan-name", {
  parent: "123456789012345678" // the ID of the category channel
})

Using CategoryChannel#createChannel()

category.createChannel("chan-name")

And lastly, not recommended though, is assigning after creation. It's not recommended as it does 2 API requests rather than 1

let channel = await guild.channels.create("chan-name")
channel.setParent("category-id")
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!