forked from Galactic/galactic-bot
35 lines
721 B
JavaScript
35 lines
721 B
JavaScript
const { EventEmitter } = require('events');
|
|
|
|
const ShardManager = require('./middleware/ShardManager.js');
|
|
const StorageManager = require('./storage/StorageManager.js');
|
|
const Logger = require('./middleware/logger/Logger.js');
|
|
|
|
class Manager extends EventEmitter {
|
|
|
|
constructor(options) {
|
|
|
|
super();
|
|
|
|
this.shardManager = new ShardManager('./structure/client/DiscordClient.js', options);
|
|
this.storageManager = new StorageManager(this, options.storage)
|
|
.initialize();
|
|
|
|
this.logger = new Logger(this);
|
|
|
|
this._built = false;
|
|
|
|
}
|
|
|
|
async build() {
|
|
|
|
await this.shardManager.spawn();
|
|
|
|
this._built = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = Manager; |