diff --git a/src/client/websocket/handlers/READY.js b/src/client/websocket/handlers/READY.js index d9fa50f..ec2df6a 100644 --- a/src/client/websocket/handlers/READY.js +++ b/src/client/websocket/handlers/READY.js @@ -23,14 +23,41 @@ async function checkUpdate(client) { return client.emit('update', `${chalk.redBright('[Fail]')} Check Update error`); } const lastest_tag = res_.data['dist-tags'].latest; - client.emit('update', Discord.version, lastest_tag); - return null; + if (client.options.checkUpdate) { + if (lastest_tag !== Discord.version && Discord.version.includes('-') == false) { + console.log(`${chalk.yellowBright('[WARNING]')} New Discord.js-selfbot-v13 version. + Old Version: ${chalk.redBright(Discord.version)} => New Version: ${chalk.greenBright(lastest_tag)} + + If you don't want to show this message, set \`checkUpdate\` to false + + new Client({ + checkUpdate: false, + }); + + and use event update + https://discordjs-self-v13.netlify.app/#/docs/docs/main/class/Client?scrollTo=e-update`); + } else { + console.log( + `${chalk.greenBright('[OK]')} Discord.js-selfbot-v13 is up to date. Version: ${chalk.blueBright( + Discord.version, + )} + + If you don't want to show this message, set \`checkUpdate\` to false + + new Client({ + checkUpdate: false, + }); + + and use event update + https://discordjs-self-v13.netlify.app/#/docs/docs/main/class/Client?scrollTo=e-update`, + ); + } + } + return client.emit('update', Discord.version, lastest_tag); } module.exports = (client, { d: data }, shard) => { - if (client.options.checkUpdate) { - checkUpdate(client); - } + checkUpdate(client); if (client.options.patchVoice) { /* eslint-disable */ diff --git a/src/util/Options.js b/src/util/Options.js index 658fad9..97d37c1 100644 --- a/src/util/Options.js +++ b/src/util/Options.js @@ -36,7 +36,7 @@ const JSONBig = require('json-bigint'); * recommended amount of shards from Discord and spawn that amount * @property {number} [closeTimeout=5000] The amount of time in milliseconds to wait for the close frame to be received * from the WebSocket. Don't have this too high/low. Its best to have it between 2_000-6_000 ms. - * @property {boolean} [checkUpdate=true] Check for module updates at startup + * @property {boolean} [checkUpdate=true] Display module update information on the screen * @property {boolean} [readyStatus=true] Sync state with Discord Client * @property {boolean} [autoCookie=true] Automatically add Cookies to Request on startup * @property {boolean} [patchVoice=true] Automatically patch @discordjs/voice module (support for call)