Create a new category

Is there anyway I can, instead of using a set category id, make the bot look for a category with the name "Groups" if found it puts the new channels inside of they, else it creates a new category named "Groups"
7 Replies
d.js toolkit
d.js toolkit6mo 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!
Diamond Pixals
Diamond PixalsOP6mo ago
node: v20.11.0 discord.js: 14.15.3
d.js docs
d.js docs6mo ago
:method: Collection#find @2.1.0 Searches for a single item where the given function returns a truthy value. This behaves like Array.find(). All collections used in Discord.js are mapped using their id property, and if you want to find by id you should use the get method. See MDN for details.
collection.find(user => user.username === 'Bob');
collection.find(user => user.username === 'Bob');
treble/luna
treble/luna6mo ago
Use that on the channel cache
Diamond Pixals
Diamond PixalsOP6mo ago
Thank you so much! How would I create a category if I can't find one?
Squid
Squid6mo ago
Call <Guild>.channels.create(...) and include type: ChannelType.GuildCategory
Diamond Pixals
Diamond PixalsOP6mo ago
ty!
Want results from more Discord servers?
Add your server