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 toolkit2y 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!
Inky
Inky2y ago
You’ll prob get an api error
Helix
HelixOP2y ago
so it's probably a good choice to check if it's full first, and maybe archive older text channels under the category
Inky
Inky2y ago
Why not just use threads?
Helix
HelixOP2y ago
does threads support embeds? I know stupid question, but I don't remember seeing an embed inside a thread
Inky
Inky2y ago
Yes
Helix
HelixOP2y 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,
});
Inky
Inky2y 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
HelixOP2y 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
Inky
Inky2y ago
You can mention roles in the thread if there’s less than 100 members that have it
Helix
HelixOP2y ago
gotcha, thank you.

Did you find this page helpful?