fix(READY): Log and typing

This commit is contained in:
Cinnamon 2022-06-25 10:28:31 +07:00
parent 6068ffc1d8
commit cd70a91aaa
3 changed files with 11 additions and 10 deletions

File diff suppressed because one or more lines are too long

View File

@ -11,8 +11,8 @@ const { Networking } = require('../../../util/Voice');
/** /**
* Emitted whenever clientOptions.checkUpdate = true * Emitted whenever clientOptions.checkUpdate = true
* @event Client#update * @event Client#update
* @param {string} oldVersion Log data :v * @param {string} oldVersion Current version
* @param {string} newVersion Log data :)) ehe * @param {string} newVersion Latest version
*/ */
async function checkUpdate(client) { async function checkUpdate(client) {
@ -25,8 +25,9 @@ async function checkUpdate(client) {
const lastest_tag = res_.data['dist-tags'].latest; const lastest_tag = res_.data['dist-tags'].latest;
if (client.options.checkUpdate) { if (client.options.checkUpdate) {
if (lastest_tag !== Discord.version && Discord.version.includes('-') == false) { if (lastest_tag !== Discord.version && Discord.version.includes('-') == false) {
console.log(`${chalk.yellowBright('[WARNING]')} New Discord.js-selfbot-v13 version. console.log(`
Old Version: ${chalk.redBright(Discord.version)} => New Version: ${chalk.greenBright(lastest_tag)} ${chalk.yellowBright('[WARNING]')} New Discord.js-selfbot-v13 version.
Current: ${chalk.redBright(Discord.version)} => Latest: ${chalk.greenBright(lastest_tag)}
If you don't want to show this message, set \`checkUpdate\` to false If you don't want to show this message, set \`checkUpdate\` to false
@ -34,13 +35,12 @@ async function checkUpdate(client) {
checkUpdate: false, checkUpdate: false,
}); });
and use event update and using event update
https://discordjs-self-v13.netlify.app/#/docs/docs/main/class/Client?scrollTo=e-update`); https://discordjs-self-v13.netlify.app/#/docs/docs/main/class/Client?scrollTo=e-update`);
} else { } else {
console.log( console.log(
`${chalk.greenBright('[OK]')} Discord.js-selfbot-v13 is up to date. Version: ${chalk.blueBright( `
Discord.version, ${chalk.greenBright('[OK]')} Discord.js-selfbot-v13 is up to date. Current: ${chalk.blueBright(Discord.version)}
)}
If you don't want to show this message, set \`checkUpdate\` to false If you don't want to show this message, set \`checkUpdate\` to false
@ -48,7 +48,7 @@ async function checkUpdate(client) {
checkUpdate: false, checkUpdate: false,
}); });
and use event update and using event update
https://discordjs-self-v13.netlify.app/#/docs/docs/main/class/Client?scrollTo=e-update`, https://discordjs-self-v13.netlify.app/#/docs/docs/main/class/Client?scrollTo=e-update`,
); );
} }

1
typings/index.d.ts vendored
View File

@ -4101,6 +4101,7 @@ export interface ClientEvents extends BaseClientEvents {
relationshipAdd: [id: Snowflake, type: RelationshipTypes]; relationshipAdd: [id: Snowflake, type: RelationshipTypes];
relationshipRemove: [id: Snowflake]; relationshipRemove: [id: Snowflake];
unhandledPacket: [packet: { op: GatewayOpcodes | number; d?: any; s?: number; t?: string }, shard: WebSocketShard]; unhandledPacket: [packet: { op: GatewayOpcodes | number; d?: any; s?: number; t?: string }, shard: WebSocketShard];
update: [oldVersion: string, newVersion: string];
} }
export interface ConstantsEvents { export interface ConstantsEvents {