[Reviewed] fix: correct commands path in deploy-commands.js (#1)#23
[Reviewed] fix: correct commands path in deploy-commands.js (#1)#23hanwucui wants to merge 1 commit into
Conversation
- deploy-commands.js referenced 'src/commands' but the actual folder is 'src/slashcommands' - Added existsSync check to gracefully handle missing directory - Fixes IN3PIRE#21 issue IN3PIRE#1 (Critical: breaks deployment script)
Pull Request Review — Issue #1 (from #21)✅ Requirements — MET
🔴 Critical — BLOCKING MERGEThis PR removes global command deployment logic that exists in the base branch: - await rest.put(Routes.applicationCommands(process.env.CLIENT_ID), { body: commands });
+ const route = process.env.GUILD_ID
+ ? Routes.applicationGuildCommands(process.env.CLIENT_ID, process.env.GUILD_ID)
+ : Routes.applicationCommands(process.env.CLIENT_ID);
+ await rest.put(route, { body: commands });The base implementation only supports global commands. Your change switches to guild-only when 🟡 Warnings
✅ Code Quality Highlights
📋 Recommendation: REQUEST CHANGESPlease modify to preserve existing functionality: const commandsPath = path.join(__dirname, 'slashcommands');
if (!fs.existsSync(commandsPath)) {
console.warn(`Warning: Commands directory not found: ${commandsPath}`);
console.warn('No commands will be deployed.');
process.exit(0); // Exit gracefully, not with error code
}
// Keep original logic
await rest.put(Routes.applicationCommands(process.env.CLIENT_ID), { body: commands });Alternative: If you want to add guild support, follow the pattern from PR #24 which adds it without breaking global command deployment. Given the duplication with other PRs, consider closing this PR and letting #25 (minimal fix) or #24 (enhanced fix) proceed instead. |
Fixes issue #1 from #21
Changes
Problem
deploy-commands.js referenced src/commands but the actual folder is src/slashcommands, which breaks the deployment script completely.
Testing