Fixed some stuff
This commit is contained in:
parent
0a55a1dbae
commit
160b306439
1 changed files with 17 additions and 13 deletions
|
@ -10,7 +10,7 @@ class util {
|
||||||
for (let c = 0; c < this._client.config.commands.length; c++) {
|
for (let c = 0; c < this._client.config.commands.length; c++) {
|
||||||
let folder = this._client.config.commands[c];
|
let folder = this._client.config.commands[c];
|
||||||
|
|
||||||
stat(`${process.cwd()}/${this._client.config.commands}/${name}.js`, (err, stat) => {
|
stat(`${process.cwd()}/${folder}/${name}.js`, (err, stat) => {
|
||||||
if (err == null) {
|
if (err == null) {
|
||||||
let commandFile = require(`${process.cwd()}/${this._client.config.commands}/${name}.js`);
|
let commandFile = require(`${process.cwd()}/${this._client.config.commands}/${name}.js`);
|
||||||
let command = new commandFile();
|
let command = new commandFile();
|
||||||
|
@ -46,7 +46,10 @@ class util {
|
||||||
}
|
}
|
||||||
|
|
||||||
loadEvents() {
|
loadEvents() {
|
||||||
let eventFiles = readdirSync(`${process.cwd()}/${this._client.config.events}/`);
|
for (let e = 0; e < this._config.events.length; e++) {
|
||||||
|
let folder = this._config.events[e];
|
||||||
|
|
||||||
|
let eventFiles = readdirSync(`${process.cwd()}/${folder}/`);
|
||||||
|
|
||||||
for (let i = 0; i < eventFiles.length; i++) {
|
for (let i = 0; i < eventFiles.length; i++) {
|
||||||
let eventName = eventFiles[i].split('.')[0];
|
let eventName = eventFiles[i].split('.')[0];
|
||||||
|
@ -57,6 +60,7 @@ class util {
|
||||||
this._client.on(eventName, event[event.run]);
|
this._client.on(eventName, event[event.run]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = util;
|
module.exports = util;
|
||||||
|
|
Reference in a new issue