accomodations for API integration
This commit is contained in:
parent
fd4c6a44f5
commit
44251ed305
@ -38,9 +38,11 @@ class Manager extends EventEmitter {
|
||||
// G:\Documents\My programs\GBot\New GBot\api\index.cjs
|
||||
this.info('Shards done, booting up API...');
|
||||
const { default: APIManager } = await import('./api/index.js').catch((err) => this.error(`Import of API Manager failed.\n${err.stack}`));
|
||||
this.apiManager = new APIManager(this);
|
||||
await this.apiManager.init();
|
||||
this.info('API done. Manager built.');
|
||||
if (APIManager) {
|
||||
this.apiManager = new APIManager(this);
|
||||
await this.apiManager.init();
|
||||
this.info('API done. Manager built.');
|
||||
} else this.info('Missing API source, skipping');
|
||||
|
||||
this._built = true;
|
||||
this.emit('built');
|
||||
|
@ -47,10 +47,10 @@ class Logger {
|
||||
|
||||
}
|
||||
|
||||
write(type = 'silly', string = '', shard = null) {
|
||||
write(type = 'silly', string = '', shard = null, api = false) {
|
||||
|
||||
const color = Constants.Colors[type];
|
||||
const header = `${chalk[color](`[${this.date}][${shard ? `shard${this._shardId(shard)}` : 'manager'}]`)}`;
|
||||
const header = `${chalk[color](`[${this.date}][${shard ? `${api ? 'api-' : ''}shard${this._shardId(shard)}` : `${api ? 'api-' : ''}manager`}]`)}`;
|
||||
|
||||
|
||||
this.logger.log(type, `${header} : ${string}`);
|
||||
@ -60,7 +60,7 @@ class Logger {
|
||||
//Messages coming from the shards process.send functions.
|
||||
_handleMessage(shard, message) {
|
||||
|
||||
this.write(message.type, message.message, shard);
|
||||
this.write(message.type, message.message, shard, message._api);
|
||||
|
||||
}
|
||||
|
||||
|
@ -104,7 +104,7 @@ class MessageCache extends Observer {
|
||||
if(message.attachments.size > 0
|
||||
&& message.guild.premium >= 2
|
||||
&& messageLog.channel
|
||||
&& !messageLog.ignoredChannels.includes(message.channel.id)
|
||||
&& !messageLog.ignore.includes(message.channel.id)
|
||||
&& !ignoredRole) {
|
||||
|
||||
let size = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user