summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--commands.ts11
1 files changed, 10 insertions, 1 deletions
diff --git a/commands.ts b/commands.ts
index cb3158a..311d54c 100644
--- a/commands.ts
+++ b/commands.ts
@@ -151,6 +151,15 @@ async function archiveCtf(interaction: ChatInputCommandInteraction) {
.map(overwrite => forum.permissionOverwrites.delete(overwrite.id))
);
+ let channels = await interaction.guild.channels.fetch();
+ let archiveCategory = channels.find(
+ channel => channel?.type === ChannelType.GuildCategory && ["Archive", "archive"].includes(channel.name)
+ );
+
+ if (archiveCategory) {
+ await forum.setParent(archiveCategory.id, { lockPermissions: false });
+ }
+
await interaction.reply({
content: `Updated ${forum.name}: @everyone can read, (mostly) no-one can write.`,
flags: "Ephemeral",
@@ -258,7 +267,7 @@ async function handleJoinCtfButton(interaction: ButtonInteraction, forumId: stri
});
await interaction.reply({
- content: `Granted you access to ${forumChannel.name}.`,
+ content: `Granted you access to https://discord.com/channels/${interaction.guild.id}/${forumChannel.id}`,
flags: "Ephemeral",
});
}