CategoryChannel permission overwrites

export default {
  data: new SlashCommandBuilder()
...
   .addChannelOption(x => x.setName('channel').setDescription('The category or channel to hide')
.addChannelTypes(ChannelType.GuildCategory, ChannelType.GuildText)),
  async execute(client: Client, interaction: ChatInputCommandInteraction) {
    const channel = interaction.options.getChannel("channel") || interaction.channel?.id;

    channel!.permissionOverwrites.edit(interaction.guild!.id, { ViewChannel: false })
and error is
unknown.png
Was this page helpful?