diff options
| author | Mathias Magnusson <mathias@magnusson.space> | 2026-01-21 16:06:21 +0100 |
|---|---|---|
| committer | Mathias Magnusson <mathias@magnusson.space> | 2026-01-21 16:06:21 +0100 |
| commit | 0f28dfc85127badd5333bf99060a905835aac224 (patch) | |
| tree | 9c1c0744c30da7192b5959380290026258e5632d /commands.ts | |
| parent | 1d6bd068ccec00486cc99e2b35a746d1afaf3764 (diff) | |
| download | challe-anka-0f28dfc85127badd5333bf99060a905835aac224.tar.gz | |
fix permissions stuff
Diffstat (limited to 'commands.ts')
| -rw-r--r-- | commands.ts | 10 |
1 files changed, 9 insertions, 1 deletions
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], + }, ], }); |
