to-do: command/event hotreloading
This commit is contained in:
parent
e34d8cac57
commit
85d0255ccc
1 changed files with 21 additions and 1 deletions
22
bot/index.js
22
bot/index.js
|
@ -63,6 +63,16 @@ class WoomyClient extends Eris.Client {
|
||||||
this.logger.success('COMMAND_LOADER_SUCCESS', `Loaded ${this.commands.size}/${this.commandFiles.length} commands.`);
|
this.logger.success('COMMAND_LOADER_SUCCESS', `Loaded ${this.commands.size}/${this.commandFiles.length} commands.`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
reloadCommands () {
|
||||||
|
for (const file of this.commandFiles) {
|
||||||
|
try {
|
||||||
|
|
||||||
|
} catch (error) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
loadEventModules () {
|
loadEventModules () {
|
||||||
const nameRegexp = /[^/]*$/;
|
const nameRegexp = /[^/]*$/;
|
||||||
const catRegexp = /.+?(?=\/)/;
|
const catRegexp = /.+?(?=\/)/;
|
||||||
|
@ -75,10 +85,20 @@ class WoomyClient extends Eris.Client {
|
||||||
this.logger.error('EVENT_LOADER_ERROR', `Failed to load ${file}: ${error}`);
|
this.logger.error('EVENT_LOADER_ERROR', `Failed to load ${file}: ${error}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
console.log(this.eventModules)
|
||||||
this.logger.success('EVENT_LOADER_SUCCESS', `Loaded ${this.eventModules.size}/${this.eventFiles.length} event modules.`);
|
this.logger.success('EVENT_LOADER_SUCCESS', `Loaded ${this.eventModules.size}/${this.eventFiles.length} event modules.`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
reloadEventModules () {
|
||||||
|
for (const file of this.eventFiles) {
|
||||||
|
try {
|
||||||
|
|
||||||
|
} catch (error) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
mainEventListener (wsEvent, param_1, param_2) {
|
mainEventListener (wsEvent, param_1, param_2) {
|
||||||
try {
|
try {
|
||||||
this.eventHandler.handle(wsEvent, param_1, param_2);
|
this.eventHandler.handle(wsEvent, param_1, param_2);
|
||||||
|
|
Loading…
Reference in a new issue