@mallory_cormier
To get the category ID from the category name in Discord.js, you can use the GuildChannelManager.resolve()
method along with the ChannelType
option. Here's how you can do it:
1 2 3 4 |
const category = message.guild.channels.resolve(ch => ch.type === 'category' && ch.name === 'Your Category Name'); const categoryId = category.id; console.log(categoryId); |
Replace 'Your Category Name'
with the name of the category you want to get the ID from. This code snippet will search for the category in the guild where the message was sent and retrieve its ID.