diff --git a/src/env.ts b/src/env.ts index ad1535c..fb9334c 100644 --- a/src/env.ts +++ b/src/env.ts @@ -45,18 +45,10 @@ export const config = { channelId: optionalEnv('ONBOARDING_CHANNEL_ID'), roleId: optionalEnv('ONBOARDING_ROLE_ID'), }, - // Add more config sections as needed: - // database: { - // url: requireEnv('DATABASE_URL'), - // }, - // api: { - // openaiKey: optionalEnv('OPENAI_API_KEY'), - // }, }; export type Config = typeof config; -// Log loaded configuration (without sensitive values) console.log('✅ Configuration loaded successfully'); console.log( `📋 Client ID: ${config.discord.clientId ? config.discord.clientId : '❌ missing'}` diff --git a/src/features/docs/types.ts b/src/features/docs/types.ts index 8dd2544..41e9dc1 100644 --- a/src/features/docs/types.ts +++ b/src/features/docs/types.ts @@ -22,17 +22,15 @@ export type ProviderConfig = { createActionBuilders: (data: Collection) => ActionBuilders; - // Create result embeds to show after selection createResultEmbeds: ( data: Collection ) => EmbedBuilder | EmbedBuilder[]; - // Get display title for an item getDisplayTitle: (item: Item) => string; - // Get selection content message + // e.g. "Select a result for **{query}**" getSelectionMessage: (query: string) => string; - // Get display message after selection + // e.g. "Showing results for **{selected}**" getDisplayMessage: (selectedTitles: string[]) => string; }; diff --git a/src/features/docs/utils.ts b/src/features/docs/utils.ts index e728055..7f4e205 100644 --- a/src/features/docs/utils.ts +++ b/src/features/docs/utils.ts @@ -6,7 +6,6 @@ import type { ProviderConfig } from './types.js'; export const SEARCH_TERM = '%SEARCH%'; export const TERM = '%TERM%'; -// Utility functions export const getSearchUrl = (url: string, search: string) => { return url.replace(SEARCH_TERM, encodeURIComponent(search)); }; diff --git a/src/features/guides/index.ts b/src/features/guides/index.ts index 11f4a8d..daa3cc6 100644 --- a/src/features/guides/index.ts +++ b/src/features/guides/index.ts @@ -4,7 +4,6 @@ import { createSlashCommand } from '../../common/commands/create-commands.js'; import { logToChannel } from '../../util/channel-logging.js'; import { loadMarkdownOptions } from '../../util/markdown.js'; -// const subjectsDir = new URL('assets/guides', import.meta.url); const subjectsDir = path.join(process.cwd(), 'assets/guides'); const subjectChoices = new Map(); diff --git a/src/features/guild-create/index.ts b/src/features/guild-create/index.ts index d66f091..acf2ad2 100644 --- a/src/features/guild-create/index.ts +++ b/src/features/guild-create/index.ts @@ -7,7 +7,6 @@ export const guildCreateEvent = createEvent( name: Events.GuildCreate, }, async (guild) => { - // Leave the server if it's not the allowed one await leaveIfNotAllowedServer(guild); } ); diff --git a/src/features/just-ask/just-ask.ts b/src/features/just-ask/just-ask.ts index fb6070a..e0deeae 100644 --- a/src/features/just-ask/just-ask.ts +++ b/src/features/just-ask/just-ask.ts @@ -29,7 +29,6 @@ const askToAskPattern = new RegExp( export const isAskingToAsk = (text: string) => askToAskPattern.test(text); const [response] = await loadMarkdownOptions<{ name: string }>( - // new URL('../tips/subjects/', import.meta.url), path.join(process.cwd(), 'assets/tips/'), 'justask.md' ); diff --git a/src/features/onboarding/component.ts b/src/features/onboarding/component.ts index af2cc5c..e549354 100644 --- a/src/features/onboarding/component.ts +++ b/src/features/onboarding/component.ts @@ -6,7 +6,6 @@ import { type MessageActionRowComponentBuilder, } from 'discord.js'; -// Exported at the bottom after all child components are added const containerComponent = new ContainerBuilder(); const actionRowComponent = diff --git a/src/features/tips/index.ts b/src/features/tips/index.ts index 47bac17..4502296 100644 --- a/src/features/tips/index.ts +++ b/src/features/tips/index.ts @@ -7,7 +7,6 @@ import { import { logToChannel } from '@/util/channel-logging.js'; import { loadMarkdownOptions } from '@/util/markdown.js'; -// const subjectsDir = new URL('assets/tips', import.meta.url); const subjectsDir = path.join(process.cwd(), 'assets/tips'); const subjectChoices = new Map(); diff --git a/src/index.ts b/src/index.ts index 6d427af..0d80700 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,7 +2,6 @@ import { ActivityType, Client, GatewayIntentBits } from 'discord.js'; import { loadEvents } from './common/events/load-events.js'; import { config } from './env.js'; -// Create a new client instance const client = new Client({ intents: [ GatewayIntentBits.Guilds, diff --git a/src/loadEnvFile.ts b/src/loadEnvFile.ts index ffdcb85..149fcaf 100644 --- a/src/loadEnvFile.ts +++ b/src/loadEnvFile.ts @@ -1,7 +1,6 @@ import { existsSync, readFileSync } from 'node:fs'; import { join } from 'node:path'; -// Simple .env loader without external dependencies function loadEnvFile(filePath: string) { if (!existsSync(filePath)) { console.warn(`Warning: File ${filePath} not found`); @@ -32,7 +31,6 @@ function loadEnvFile(filePath: string) { } } -// Determine environment (defaults to development) const nodeEnv = process.env.NODE_ENV || 'development'; console.log(`🌍 Environment: ${nodeEnv}`); diff --git a/src/util/advent-scheduler.test.ts b/src/util/advent-scheduler.test.ts index ae201cc..1ef0166 100644 --- a/src/util/advent-scheduler.test.ts +++ b/src/util/advent-scheduler.test.ts @@ -3,7 +3,6 @@ import { promises as fs } from 'node:fs'; import test from 'node:test'; import { config } from '@/env.js'; -// Import after setting env var const { loadTracker, saveTracker } = await import('./advent-scheduler.js'); async function cleanupTestTracker() { @@ -45,6 +44,5 @@ void test('advent scheduler: tracker file operations', async (t) => { assert.ok(loaded['2025'].includes(25)); }); - // Cleanup await cleanupTestTracker(); }); diff --git a/src/util/markdown.ts b/src/util/markdown.ts index 1ac06a3..942c6ff 100644 --- a/src/util/markdown.ts +++ b/src/util/markdown.ts @@ -56,7 +56,6 @@ export const loadMarkdownOptions = async >( const results: Array<{ frontmatter: Partial; content: string }> = []; for (const file of markdownFiles) { - // const filePath = new URL(`${path}/${file}`, import.meta.url); const filePath = path.join(sourcePath.toString(), file); const fileContent = await readFile(filePath, 'utf-8'); diff --git a/src/util/post-guides.ts b/src/util/post-guides.ts index f833bd1..e5412b7 100644 --- a/src/util/post-guides.ts +++ b/src/util/post-guides.ts @@ -38,10 +38,8 @@ export type GuideTracker = { }; }; -// const GUIDES_DIR = fileURLToPath(new URL('../features/guides/subjects/', import.meta.url)); const GUIDES_DIR = path.join(process.cwd(), 'assets/guides'); -// const TRACKER_FILE = config.guidesTrackerPath ?? 'guides-tracker.json'; const TRACKER_FILE = config.guidesTrackerPath ?? path.join(process.cwd(), 'guides-tracker.json'); @@ -162,14 +160,13 @@ export const syncGuidesToChannel = async ( const tracker = await loadTracker(); const currentGuides = await scanGuideFiles(); - // Create maps for easier lookup const currentGuideMap = new Map( currentGuides.map((guide) => [guide.filename, guide]) ); const trackedFiles = new Set(Object.keys(tracker)); const currentFiles = new Set(currentGuides.map((guide) => guide.filename)); - // Find changes + // Check for changes const newFiles = [...currentFiles].filter( (file) => !trackedFiles.has(file) ); @@ -246,7 +243,7 @@ export const initializeGuidesChannel = async ( ): Promise => { console.log('🚀 Initializing guides channel...'); - // Clear existing tracker for fresh start + // Clear existing tracker await saveTracker({}); await syncGuidesToChannel(client, channelId);