diff options
Diffstat (limited to 'commands.ts')
| -rw-r--r-- | commands.ts | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/commands.ts b/commands.ts index 3b72c3a..2b7f8e7 100644 --- a/commands.ts +++ b/commands.ts @@ -31,6 +31,11 @@ export let slashCommands = [ .setName("message") .setDescription("Contents of the initial post in the general thread. Should probably be a link to the CTF platform.") .setRequired(true) + ) + .addStringOption( + new SlashCommandStringOption() + .setName("tags") + .setDescription("A comma-separated list of tags to add to the forum. Defaults to the most common CTF categories.") ), handler: newCtf, }, @@ -96,6 +101,7 @@ async function newCtf(interaction: ChatInputCommandInteraction) { let name = interaction.options.getString("name", true); let link = interaction.options.getString("message", true); + let tags = interaction.options.getString("tags"); await interaction.deferReply({ flags: "Ephemeral" }); let forum = await interaction.guild.channels.create({ @@ -109,6 +115,8 @@ async function newCtf(interaction: ChatInputCommandInteraction) { ], }); + await forum.setAvailableTags((tags?.split(",") ?? ["web", "pwn", "rev", "crypto"]).map(name => ({ name, moderated: false }))); + await ensureUnsolvedTag(forum); let generalThread = await forum.threads.create({ |
