summaryrefslogtreecommitdiff
path: root/commands.ts
diff options
context:
space:
mode:
Diffstat (limited to 'commands.ts')
-rw-r--r--commands.ts10
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],
+ },
],
});