Clear console.log, checkUpdate in ClientOptions

This commit is contained in:
March 7th 2022-03-21 10:56:51 +07:00
parent ec9428f9c2
commit bb3d582f61
3 changed files with 29 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "discord.js-selfbot-v13", "name": "discord.js-selfbot-v13",
"version": "0.1.3", "version": "0.1.4",
"description": "A unofficial discord.js fork for creating selfbots [Based on discord.js v13]", "description": "A unofficial discord.js fork for creating selfbots [Based on discord.js v13]",
"main": "./src/index.js", "main": "./src/index.js",
"types": "./typings/index.d.ts", "types": "./typings/index.d.ts",
@ -45,6 +45,7 @@
"@sapphire/snowflake": "^3.2.0", "@sapphire/snowflake": "^3.2.0",
"@types/ws": "^8.5.2", "@types/ws": "^8.5.2",
"axios": "^0.26.1", "axios": "^0.26.1",
"chalk": "^4.1.2",
"discord-api-types": "^0.27.3", "discord-api-types": "^0.27.3",
"discord.js": "^13.6.0", "discord.js": "^13.6.0",
"form-data": "^4.0.0", "form-data": "^4.0.0",

View File

@ -3,10 +3,35 @@
const ClientApplication = require('../../../structures/ClientApplication'); const ClientApplication = require('../../../structures/ClientApplication');
const User = require('../../../structures/User'); const User = require('../../../structures/User');
let ClientUser; let ClientUser;
const chalk = require('chalk');
const axios = require('axios');
const Discord = require('discord.js-selfbot-v13');
const checkUpdate = async () => {
const res_ = await axios.get(
`https://registry.npmjs.com/${encodeURIComponent('discord.js-selfbot-v13')}`,
);
const lastest_tag = res_.data['dist-tags'].latest;
// Checking if the package is outdated
// Stable version
if (lastest_tag !== Discord.version) {
return console.log(`${chalk.yellowBright(
'[WARNING]',
)} New Discord.js-selfbot-v13 Stable version.
${chalk.redBright(Discord.version)} => ${chalk.greenBright(lastest_tag)}`);
}
return console.log(
`${chalk.greenBright(
'[OK]',
)} Discord.js-selfbot-v13 [Stable] is up to date. Version: ${chalk.blueBright(
Discord.version,
)}`,
);
};
module.exports = (client, { d: data }, shard) => { module.exports = (client, { d: data }, shard) => {
// console.log(data); // console.log(data);
if (client.options.checkUpdate) checkUpdate();
client.session_id = data.session_id; client.session_id = data.session_id;
if (client.user) { if (client.user) {
client.user._patch(data.user); client.user._patch(data.user);

View File

@ -128,6 +128,7 @@ class Options extends null {
scheduledEvent: 'https://discord.com/events', scheduledEvent: 'https://discord.com/events',
}, },
jsonTransformer: (object) => JSONBig.stringify(object), jsonTransformer: (object) => JSONBig.stringify(object),
checkUpdate: true,
}; };
} }