diff --git a/src/client/events.js b/src/client/events.js index 8301174..0180a7a 100644 --- a/src/client/events.js +++ b/src/client/events.js @@ -10,13 +10,13 @@ class event { // Get the prefix from the config let prefix = this.config.prefix; - // If the message starts with the prefix, then treat it as a command + // If the message starts with the prefix, then treat it as a command if (message.content.substring(0, prefix.length).toLowerCase() == prefix.toLowerCase()) { // Get the arguments in the message, after the first space (after the command name) let args = message.content.substring(prefix.length).split(" "); let name = args.shift(); - // Load the command from the util class + // Load the command from the util class this.util.loadCommand(name, args, message); } } diff --git a/src/client/util.js b/src/client/util.js index 030877b..bd6b0a7 100644 --- a/src/client/util.js +++ b/src/client/util.js @@ -11,24 +11,24 @@ class util { // Load a command and send the arguments with it loadCommand(name, args, message) { - // Loop through all folders set in config - // c = command folder index + // Loop through all folders set in config + // c = command folder index for (let c = 0; c < this._client.config.commands.length; c++) { - // Get the current folder to check + // Get the current folder to check let folder = this._client.config.commands[c]; - // See if the folder being checked has the command being sent + // See if the folder being checked has the command being sent stat(`${process.cwd()}/${folder}/${name}.js`, err => { - // If no error, attempt to run the command + // If no error, attempt to run the command if (err == null) { - // Require the command file, now that we know it exists and initialise it + // Require the command file, now that we know it exists and initialise it let commandFile = require(`${process.cwd()}/${folder}/${name}.js`); let command = new commandFile(); - // Get the list of required configurations the command needs + // Get the list of required configurations the command needs let requiredConfigs = command.requiredConfigs; - // Loop through all the required configs of the command + // Loop through all the required configs of the command for (let i = 0; i < requiredConfigs.length; i++) { // If the command doesn't have the configs in the config string, throw an error if (!this._client.config[name]) throw `${commandFile.name} requires ${requiredConfigs[i]} in it's configuration`;