From 85d0255cccb7eb6922f87c481a69b7723c0e9aff Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Wed, 21 Oct 2020 01:03:16 +1100 Subject: [PATCH] to-do: command/event hotreloading --- bot/index.js | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/bot/index.js b/bot/index.js index 4a44180..062d170 100644 --- a/bot/index.js +++ b/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.`); } + reloadCommands () { + for (const file of this.commandFiles) { + try { + + } catch (error) { + + } + } + } + loadEventModules () { const nameRegexp = /[^/]*$/; const catRegexp = /.+?(?=\/)/; @@ -75,10 +85,20 @@ class WoomyClient extends Eris.Client { 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.`); } + reloadEventModules () { + for (const file of this.eventFiles) { + try { + + } catch (error) { + + } + } + } + mainEventListener (wsEvent, param_1, param_2) { try { this.eventHandler.handle(wsEvent, param_1, param_2);