diff options
| author | Mathias Magnusson <mathias@magnusson.space> | 2026-01-17 02:06:10 +0100 |
|---|---|---|
| committer | Mathias Magnusson <mathias@magnusson.space> | 2026-01-17 02:06:10 +0100 |
| commit | df1015e9bb1a457acc99ac62b89f17146f9092ab (patch) | |
| tree | c80395e3257bf8d87c6fdba06f851a167d1b143b | |
| parent | ac23b1f60e99269711727e92be83231ea9c310e1 (diff) | |
| download | challe-anka-df1015e9bb1a457acc99ac62b89f17146f9092ab.tar.gz | |
add some challenge category tags
| -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({ |
