Permission Overwrites

Does the bot need administrator permission to set permission overwrites on a channel? It's only working for me if the bot has administrator permissions, but I feel like that shouldn't be the case. discord version: discord.js@14.14.1 node version: v20.10.0
const newChannel = await i.guild.channels.create({
name: ticketName,
type: ChannelType.GuildText,
parent: ticketCategoryId,
permissionOverwrites: [
{
id: i.guild.roles.everyone.id,
deny: [PermissionsBitField.Flags.ViewChannel],
},
{
id: i.user.id,
deny: [PermissionsBitField.Flags.SendMessages],
},
],
})
const newChannel = await i.guild.channels.create({
name: ticketName,
type: ChannelType.GuildText,
parent: ticketCategoryId,
permissionOverwrites: [
{
id: i.guild.roles.everyone.id,
deny: [PermissionsBitField.Flags.ViewChannel],
},
{
id: i.user.id,
deny: [PermissionsBitField.Flags.SendMessages],
},
],
})
3 Replies
d.js toolkit
d.js toolkit•5mo 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!
Toast
Toast•5mo ago
manage channels perm i believe is required to adjust the channel perms
Goose
Goose•5mo ago
the bot has that permission already but it doesn't work it has every permission besides administrator at the moment If I remove the part that denies view permissions, it still has the same error That appears to have been the problem. I thought the view channels permission allowed it to view all channels by default thanks for the help 🙂