Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ loadCommands('prefixcommands', client.prefixCommands);

const loadEvents = () => {
const eventsPath = path.join(__dirname, 'events');
if (!fs.existsSync(eventsPath)) {
console.warn('Warning: events directory not found.');
return;
}
const eventFiles = fs.readdirSync(eventsPath).filter(f => f.endsWith('.js'));

for (const file of eventFiles) {
Expand Down
8 changes: 7 additions & 1 deletion src/deploy-commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ const fs = require('fs');
const path = require('path');

const commands = [];
const commandsPath = path.join(__dirname, 'commands');
const commandsPath = path.join(__dirname, 'slashcommands');

if (!fs.existsSync(commandsPath)) {
console.error(`Error: The directory ${commandsPath} does not exist.`);
process.exit(1);
}

const commandFiles = fs.readdirSync(commandsPath).filter(f => f.endsWith('.js'));

for (const file of commandFiles) {
Expand Down