fix: Still showing log even though checkUpdate is false

This commit is contained in:
Elysia 2023-05-22 19:02:17 +07:00
parent 4b329c8105
commit c902304236
2 changed files with 13 additions and 13 deletions

View File

@ -536,6 +536,7 @@ class Client extends BaseClient {
try { try {
const latest_tag = res_.data['dist-tags'].latest; const latest_tag = res_.data['dist-tags'].latest;
this.emit('update', Discord.version, latest_tag); this.emit('update', Discord.version, latest_tag);
this.emit('debug', `${chalk.greenBright('[OK]')} Check Update success`);
} catch { } catch {
this.emit('debug', `${chalk.redBright('[Fail]')} Check Update error`); this.emit('debug', `${chalk.redBright('[Fail]')} Check Update error`);
this.emit('update', Discord.version, false); this.emit('update', Discord.version, false);

View File

@ -42,6 +42,7 @@ function patchVoice(client) {
module.exports = async (client, { d: data }, shard) => { module.exports = async (client, { d: data }, shard) => {
if (!firstReady) { if (!firstReady) {
if (client.options.checkUpdate) {
client.once('update', (currentVersion, newVersion) => { client.once('update', (currentVersion, newVersion) => {
if (!newVersion) { if (!newVersion) {
console.log(` console.log(`
@ -85,8 +86,6 @@ module.exports = async (client, { d: data }, shard) => {
); );
} }
}); });
if (client.options.checkUpdate === false) {
client.checkUpdate(); client.checkUpdate();
} }