2020-04-08 16:01:31 +02:00
|
|
|
const { EventEmitter } = require('events');
|
2020-04-08 16:27:34 +02:00
|
|
|
const options = require('./options.json');
|
|
|
|
|
|
|
|
|
2020-04-08 16:01:31 +02:00
|
|
|
|
|
|
|
class Manager extends EventEmitter {
|
|
|
|
|
2020-04-08 16:27:34 +02:00
|
|
|
constructor(options) {
|
|
|
|
|
|
|
|
this.registry = new Registry(this);
|
|
|
|
this.storageManager = new StorageManager(this, options.storage)
|
|
|
|
.initialize();
|
|
|
|
|
|
|
|
this.logger = new Logger(this);
|
|
|
|
|
|
|
|
this._built = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
async build() {
|
|
|
|
|
|
|
|
await this.registry.loadComponents('components/commands/', Command);
|
|
|
|
|
|
|
|
this._built = true;
|
|
|
|
|
|
|
|
}
|
2020-04-08 16:01:31 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2020-04-08 16:27:34 +02:00
|
|
|
|
|
|
|
|
2020-04-08 16:01:31 +02:00
|
|
|
module.exports = Manager;
|