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 })
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 })