misc fixes n shit

This commit is contained in:
Erik 2022-05-13 11:07:27 +03:00
parent 4eaefa3279
commit 099f994335
Signed by: Navy.gif
GPG Key ID: 811EC0CD80E7E5FB
3 changed files with 18 additions and 6 deletions

View File

@ -41,9 +41,10 @@ class BaseClient extends EventEmitter {
this.logger.status(`Shards spawned, spawned ${this.shardingManager.shards.size} shards. Took ${Date.now() - start} ms`);
const API = this._options.api.load ? await import('/Documents/My programs/GBot/api/index.js')
.catch(() => this.logger.warn(`Error importing API files, continuing without`)) : null;
// const API = await import('./api/index.js').catch(() => this.logger.warn(`Error importing API files, continuing without`));
// const API = this._options.api.load ? await import('/Documents/My programs/GBot/api/index.js')
// .catch(() => this.logger.warn(`Error importing API files, continuing without`)) : null;
let API = null;
if(this._options.api.load) API = await import('../../api/index.js').catch(() => this.logger.warn(`Error importing API files, continuing without`));
if (API) {
this.logger.info('Booting up API');
const { default: APIManager } = API;

View File

@ -196,7 +196,7 @@ class DiscordClient extends Client {
const result = await this.shard.broadcastEval((client) => client.users.cache.size).catch(() => null);
if (!result) return;
const userCount = result.reduce((p, v) => p+v, 0);
this.user.setActivity(`to ${userCount} users`, { type: 'LISTENING' });
this.user.setActivity(`${userCount} users`, { type: 'LISTENING' });
},
2: async () => {
this.user.setActivity("for /help", { type: 'LISTENING' });
@ -215,6 +215,10 @@ class DiscordClient extends Client {
return this.shard.count === 1;
}
get shardId() {
return this.shard.ids[0];
}
/**
* @private
*/
@ -312,8 +316,15 @@ class DiscordClient extends Client {
});
}
resolveUsers(...opts) {
return this.resolver.resolveUsers(...opts);
}
resolveUser(...opts) {
return this.resolver.resolveUser(...opts);
}
get prefix() {
return this._options.discord.prefix;
}

View File

@ -14,7 +14,7 @@ class Observer extends Component {
});
this.name = options.name;
this.priority = options.priority || 1; // Lower is higher
this.priority = options.priority || 10; // Lower is higher
this.hooks = options.hooks || [];
this.logger = new Logger(this);