diff --git a/utils/commands.js b/utils/commands.js index 6988392..2a0c25d 100644 --- a/utils/commands.js +++ b/utils/commands.js @@ -7,9 +7,13 @@ function getCommands() { .map((file) => file.replace(".js", "")); for (let file of commandFiles) { - import(`../commands/${file}.js`).then((cmd) => - commands.push((commands[file] = cmd.command)) - ); + import(`../commands/${file}.js`) + .then((cmd) => commands.push((commands[file] = cmd.command))) + .catch((err) => + console.error( + `Error when trying to read command file ${file}: ${err.message}` + ) + ); } return commands;