From c910cfa4d979690cb66fb57eff8e00f13b0a357a Mon Sep 17 00:00:00 2001 From: Ali Hammoud Date: Sat, 20 Jun 2026 20:57:04 +0300 Subject: [PATCH 1/3] feat: add SHOWCASE_RULES_CHANNEL_ID env --- .env.production | 2 ++ src/env.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/.env.production b/.env.production index 5be172e..1b04eb7 100644 --- a/.env.production +++ b/.env.production @@ -11,6 +11,8 @@ REPEL_LOG_CHANNEL_ID=1403558160144531589 ADVENT_OF_CODE_CHANNEL_ID=1047623689488830495 SHOWCASE_CHANNEL_ID=1517161718818541658 SHOWCASE_LOG_CHANNEL_ID=1517565847982444634 +SHOWCASE_RULES_CHANNEL_ID=1517948527098073158 + # Role IDs (from your dev server) REPEL_ROLE_ID=1002411741776461844 diff --git a/src/env.ts b/src/env.ts index fb9334c..c35b3b6 100644 --- a/src/env.ts +++ b/src/env.ts @@ -40,6 +40,7 @@ export const config = { adventOfCode: requireEnv('ADVENT_OF_CODE_CHANNEL_ID'), showcase: requireEnv('SHOWCASE_CHANNEL_ID'), showcaseLogs: requireEnv('SHOWCASE_LOG_CHANNEL_ID'), + showcaseRules: requireEnv('SHOWCASE_RULES_CHANNEL_ID'), }, onboarding: { channelId: optionalEnv('ONBOARDING_CHANNEL_ID'), From 16afe99918c9c8cc1c98697a89b4ae42a9a804f7 Mon Sep 17 00:00:00 2001 From: Ali Hammoud Date: Sat, 20 Jun 2026 20:57:51 +0300 Subject: [PATCH 2/3] feat: switch to a dedicated channel instead of forum post --- src/features/showcase/send-pinned-message.ts | 40 +++++++------------- 1 file changed, 13 insertions(+), 27 deletions(-) diff --git a/src/features/showcase/send-pinned-message.ts b/src/features/showcase/send-pinned-message.ts index f4be345..6acb71e 100644 --- a/src/features/showcase/send-pinned-message.ts +++ b/src/features/showcase/send-pinned-message.ts @@ -2,7 +2,6 @@ import { ActionRowBuilder, ButtonBuilder, ButtonStyle, - ChannelFlags, type MessageActionRowComponentBuilder, MessageFlags, PermissionFlagsBits, @@ -22,20 +21,15 @@ export const sendShowcasePinnedMessage = createSlashCommand({ execute: async (interaction) => { await interaction.deferReply({ flags: MessageFlags.Ephemeral }); const showcaseChannel = interaction.guild?.channels.cache.get( - config.channelIds.showcase + config.channelIds.showcaseRules ); - if (showcaseChannel === undefined || !showcaseChannel.isThreadOnly()) { + if (showcaseChannel === undefined || !showcaseChannel.isTextBased()) { await interaction.editReply({ content: 'Showcase channel not found or is not a forum channel.', }); return; } - const activeThreads = await showcaseChannel.threads.fetchActive(); - const pinnedThread = activeThreads.threads.find((thread) => - thread.flags.has(ChannelFlags.Pinned) - ); - const guideLines = [ 'Welcome to the Showcase channel! Please read the rules and guidelines before posting your content. Make sure to follow the format and include all necessary information. Happy sharing!', '', @@ -59,17 +53,14 @@ export const sendShowcasePinnedMessage = createSlashCommand({ .setStyle(ButtonStyle.Primary) ); - if (pinnedThread) { - if (!pinnedThread.locked) { - await pinnedThread.setLocked(true); - } - const message = await pinnedThread.fetchStarterMessage(); - if (message !== null) { - await message.edit({ - content: guideLines, - components: [actionRow], - }); - } + const message = ( + await showcaseChannel.messages.fetch({ limit: 1 }) + ).first(); + if (message !== undefined) { + await message.edit({ + content: guideLines, + components: [actionRow], + }); await interaction.editReply({ content: 'Showcase pinned message updated successfully.', @@ -77,15 +68,10 @@ export const sendShowcasePinnedMessage = createSlashCommand({ return; } - const thread = await showcaseChannel.threads.create({ - name: 'Rules and Guidelines', - message: { - content: guideLines, - components: [actionRow], - }, + await showcaseChannel.send({ + content: guideLines, + components: [actionRow], }); - void thread.pin(); - void thread.setLocked(true); await interaction.editReply({ content: 'Showcase pinned message sent successfully.', From 91cc610fa543c4f9ec50c51460dde0b0ad9ce7eb Mon Sep 17 00:00:00 2001 From: Ali Hammoud Date: Sat, 20 Jun 2026 21:00:53 +0300 Subject: [PATCH 3/3] chore: add missing test env --- .env.test | 1 + 1 file changed, 1 insertion(+) diff --git a/.env.test b/.env.test index e6219c0..c48bb66 100644 --- a/.env.test +++ b/.env.test @@ -18,6 +18,7 @@ ADVENT_OF_CODE_CHANNEL_ID=your_advent_of_code_forum_channel_id_here REPEL_LOG_CHANNEL_ID=your-repel-log-channel-id SHOWCASE_CHANNEL_ID=your-showcase-forum-channel-id SHOWCASE_LOG_CHANNEL_ID=your-showcase-log-channel-id +SHOWCASE_RULES_CHANNEL_ID=your-showcase-rules-channel-id # Role IDs (from your dev server) REPEL_ROLE_ID=your-repel-role-id