From 0f28dfc85127badd5333bf99060a905835aac224 Mon Sep 17 00:00:00 2001 From: Mathias Magnusson Date: Wed, 21 Jan 2026 16:06:21 +0100 Subject: fix permissions stuff --- commands.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'commands.ts') diff --git a/commands.ts b/commands.ts index 7005165..3a4458f 100644 --- a/commands.ts +++ b/commands.ts @@ -113,6 +113,10 @@ async function newCtf(interaction: ChatInputCommandInteraction) { let tags = interaction.options.getString("tags"); await interaction.deferReply({ flags: "Ephemeral" }); + let botRole = interaction.guild.roles.botRoleFor(interaction.client.user); + if (!botRole) + throw new Error("Why does this bot not have a role???"); + let forum = await interaction.guild.channels.create({ name, type: ChannelType.GuildForum, @@ -120,7 +124,11 @@ async function newCtf(interaction: ChatInputCommandInteraction) { { id: interaction.guild.roles.everyone, deny: [PermissionFlagsBits.ViewChannel], - } + }, + { + id: botRole.id, + allow: [PermissionFlagsBits.ViewChannel], + }, ], }); -- cgit v1.2.3