fix: Still showing log even though checkUpdate is false
This commit is contained in:
parent
4b329c8105
commit
c902304236
@ -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);
|
||||||
|
@ -42,9 +42,10 @@ function patchVoice(client) {
|
|||||||
|
|
||||||
module.exports = async (client, { d: data }, shard) => {
|
module.exports = async (client, { d: data }, shard) => {
|
||||||
if (!firstReady) {
|
if (!firstReady) {
|
||||||
client.once('update', (currentVersion, newVersion) => {
|
if (client.options.checkUpdate) {
|
||||||
if (!newVersion) {
|
client.once('update', (currentVersion, newVersion) => {
|
||||||
console.log(`
|
if (!newVersion) {
|
||||||
|
console.log(`
|
||||||
${chalk.redBright('[WARNING]')} Cannot check new Discord.js-selfbot-v13 version.
|
${chalk.redBright('[WARNING]')} Cannot check new Discord.js-selfbot-v13 version.
|
||||||
Current: ${chalk.blueBright(currentVersion)}
|
Current: ${chalk.blueBright(currentVersion)}
|
||||||
|
|
||||||
@ -56,8 +57,8 @@ module.exports = async (client, { d: data }, shard) => {
|
|||||||
|
|
||||||
and using event update
|
and using event update
|
||||||
https://discordjs-self-v13.netlify.app/#/docs/docs/main/class/Client?scrollTo=e-update\n`);
|
https://discordjs-self-v13.netlify.app/#/docs/docs/main/class/Client?scrollTo=e-update\n`);
|
||||||
} else if (currentVersion !== newVersion && !currentVersion.includes('-')) {
|
} else if (currentVersion !== newVersion && !currentVersion.includes('-')) {
|
||||||
console.log(`
|
console.log(`
|
||||||
${chalk.yellowBright('[WARNING]')} New Discord.js-selfbot-v13 version.
|
${chalk.yellowBright('[WARNING]')} New Discord.js-selfbot-v13 version.
|
||||||
Current: ${chalk.redBright(currentVersion)} => Latest: ${chalk.greenBright(newVersion)}
|
Current: ${chalk.redBright(currentVersion)} => Latest: ${chalk.greenBright(newVersion)}
|
||||||
|
|
||||||
@ -69,9 +70,9 @@ module.exports = async (client, { d: data }, shard) => {
|
|||||||
|
|
||||||
and using event update
|
and using event update
|
||||||
https://discordjs-self-v13.netlify.app/#/docs/docs/main/class/Client?scrollTo=e-update\n`);
|
https://discordjs-self-v13.netlify.app/#/docs/docs/main/class/Client?scrollTo=e-update\n`);
|
||||||
} else {
|
} else {
|
||||||
console.log(
|
console.log(
|
||||||
`
|
`
|
||||||
${chalk.greenBright('[OK]')} Discord.js-selfbot-v13 is up to date. Current: ${chalk.blueBright(currentVersion)}
|
${chalk.greenBright('[OK]')} Discord.js-selfbot-v13 is up to date. Current: ${chalk.blueBright(currentVersion)}
|
||||||
|
|
||||||
If you don't want to show this message, set ${chalk.cyanBright('checkUpdate')} to false
|
If you don't want to show this message, set ${chalk.cyanBright('checkUpdate')} to false
|
||||||
@ -82,11 +83,9 @@ module.exports = async (client, { d: data }, shard) => {
|
|||||||
|
|
||||||
and using event update
|
and using event update
|
||||||
https://discordjs-self-v13.netlify.app/#/docs/docs/main/class/Client?scrollTo=e-update\n`,
|
https://discordjs-self-v13.netlify.app/#/docs/docs/main/class/Client?scrollTo=e-update\n`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (client.options.checkUpdate === false) {
|
|
||||||
client.checkUpdate();
|
client.checkUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user