Commands now dispose properly
This commit is contained in:
@@ -72,18 +72,22 @@ export class CommandManager {
|
|||||||
console.log();
|
console.log();
|
||||||
Logger.info('Reloading Modules and Commands');
|
Logger.info('Reloading Modules and Commands');
|
||||||
|
|
||||||
// Does not call dispose function
|
for (let command in commands) {
|
||||||
for (let command of commands) {
|
await commands[command].Dispose();
|
||||||
await command.Dispose();
|
|
||||||
}
|
}
|
||||||
Logger.info('Disposed registerd commands');
|
Logger.info('Disposed registerd commands');
|
||||||
|
|
||||||
for (let mod of modules) {
|
// This broke af lol ReeEEEEeeE
|
||||||
await mod.module.Dispose();
|
for (let mod in modules) {
|
||||||
delete require.cache[require.resolve(mod.file)];
|
// Logger.error(modules[mod].module);
|
||||||
|
// await modules[mod].module.Dispose();
|
||||||
|
delete require.cache[require.resolve(modules[mod].mod)]; //file.split('.')[0])];
|
||||||
}
|
}
|
||||||
Logger.info('Disposed registerd modules');
|
Logger.info('Disposed registerd modules');
|
||||||
|
|
||||||
|
modules = [];
|
||||||
|
commands = [];
|
||||||
|
|
||||||
CommandManager.load(1);
|
CommandManager.load(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,10 +7,6 @@ export class Module {
|
|||||||
static Init() {
|
static Init() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static Dispose() {
|
|
||||||
Logger.error('module disposed')
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export class Command1 {
|
export class Command1 {
|
||||||
|
|||||||
Reference in New Issue
Block a user