32 lines
551 B
JavaScript
32 lines
551 B
JavaScript
const { EventEmitter } = require('events');
|
|
const options = require('./options.json');
|
|
|
|
|
|
|
|
class Manager extends EventEmitter {
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = Manager; |