galactic-bot/Manager.js
2020-04-09 17:25:06 +03:00

37 lines
880 B
JavaScript

const { EventEmitter } = require('events');
const ShardManager = require('./middleware/ShardManager.js');
const StorageManager = require('./storage/StorageManager.js');
const Registry = require('./Registry.js');
const { Command, Setting, Inhibitor } = require('./structure/interfaces/');
class Manager extends EventEmitter {
constructor(options) {
this.registry = new Registry(this);
this.shardManager = new ShardManager(this, './middleware/client/DiscordClient.js', options.shard)
.spawn();
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;