ChannelType.GuildCategory

Category channels can hold up to 50 channels; but what happens when you try to add an additional? I'm working on a discord bot for that creates a text channel under a parent category channel whenever someone submits a recruitment form. I'm just curious what happens if the category hits that 50 entity cap.
11 Replies
d.js toolkit
d.js toolkit15mo 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!
Kinect3000
Kinect300015mo ago
You’ll prob get an api error
Helix
HelixOP15mo ago
so it's probably a good choice to check if it's full first, and maybe archive older text channels under the category
Kinect3000
Kinect300015mo ago
Why not just use threads?
Helix
HelixOP15mo ago
does threads support embeds? I know stupid question, but I don't remember seeing an embed inside a thread
Kinect3000
Kinect300015mo ago
Yes
Helix
HelixOP15mo ago
embeds is how I'm showing the form output ah okay, yea that's definitely a better choice then I guess one additional question, can you add permissions per thread for user/roles like any other channel with the text channel I'm just doing this:
let permissionOverwrites = [
{
id: everyoneRole.id,
type: OverwriteType.Role,
deny: [PermissionFlagsBits.ViewChannel],
},
{
id: account.providerAccountId,
type: OverwriteType.Member,
allow: [
PermissionFlagsBits.ViewChannel,
PermissionFlagsBits.SendMessages,
],
},
];

if (guildRoles?.length) {
const gr = guildRoles.map((role) => {
return {
id: role.roleId,
type: OverwriteType.Role,
allow: [
PermissionFlagsBits.ViewChannel,
PermissionFlagsBits.ManageChannels,
PermissionFlagsBits.SendMessages,
],
};
});
permissionOverwrites = [...permissionOverwrites, ...gr];
}

const textChannel = <TextChannel>await guild.channels.create({
type: ChannelType.GuildText,
name: title,
parent: channel.id,
permissionOverwrites,
});
let permissionOverwrites = [
{
id: everyoneRole.id,
type: OverwriteType.Role,
deny: [PermissionFlagsBits.ViewChannel],
},
{
id: account.providerAccountId,
type: OverwriteType.Member,
allow: [
PermissionFlagsBits.ViewChannel,
PermissionFlagsBits.SendMessages,
],
},
];

if (guildRoles?.length) {
const gr = guildRoles.map((role) => {
return {
id: role.roleId,
type: OverwriteType.Role,
allow: [
PermissionFlagsBits.ViewChannel,
PermissionFlagsBits.ManageChannels,
PermissionFlagsBits.SendMessages,
],
};
});
permissionOverwrites = [...permissionOverwrites, ...gr];
}

const textChannel = <TextChannel>await guild.channels.create({
type: ChannelType.GuildText,
name: title,
parent: channel.id,
permissionOverwrites,
});
Kinect3000
Kinect300015mo ago
Not rly You can ping members and roles (if there aren’t too many members in it) into threads to give them rw access
Helix
HelixOP15mo ago
ah, okay. I'm reading the docs and it seems like I;d ahve to add each member individually if the thread is private
Kinect3000
Kinect300015mo ago
You can mention roles in the thread if there’s less than 100 members that have it
Helix
HelixOP15mo ago
gotcha, thank you.
Want results from more Discord servers?
Add your server