|
|
@ -4,6 +4,8 @@ const chalk = require('chalk'); |
|
|
|
|
|
|
|
|
|
|
|
module.exports = async (client, spinner, spinner2) => { |
|
|
|
module.exports = async (client, spinner, spinner2) => { |
|
|
|
return new Promise(async resolve => { |
|
|
|
return new Promise(async resolve => { |
|
|
|
|
|
|
|
const st = new Date().getTime(); |
|
|
|
|
|
|
|
|
|
|
|
client.misc.cache.bl = { |
|
|
|
client.misc.cache.bl = { |
|
|
|
guild: [], |
|
|
|
guild: [], |
|
|
|
user: [] |
|
|
|
user: [] |
|
|
@ -17,14 +19,20 @@ module.exports = async (client, spinner, spinner2) => { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
spinner.update({text: `${chalk.gray('[PROC]')} >> ${chalk.blueBright(`Cached`)} ${chalk.white(`${amount}`)} ${chalk.blueBright(`guild blacklists.`)}`}); |
|
|
|
spinner.update({text: `${chalk.gray('[PROC]')} >> ${chalk.blueBright(`Cached`)} ${chalk.white(`${amount}`)} ${chalk.blueBright(`guild blacklists.`)}`}); |
|
|
|
|
|
|
|
const cacheTime = new Date().getTime() - st; |
|
|
|
|
|
|
|
spinner.update({text: `${spinner.options.text.slice(0, 19).trim()} ${chalk.gray(`${cacheTime}ms >>`.padStart(8, '0').padStart(7, '0'))} ${spinner.options.text.slice(19).trim()}`}); |
|
|
|
spinner.status('non-spinnable'); |
|
|
|
spinner.status('non-spinnable'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const st2 = new Date().getTime(); |
|
|
|
|
|
|
|
|
|
|
|
for await (const user of UserData.find()) { |
|
|
|
for await (const user of UserData.find()) { |
|
|
|
if (user.blackisted) {client.misc.cache.bl.user.push(user.uid); amount2++;} |
|
|
|
if (user.blackisted) {client.misc.cache.bl.user.push(user.uid); amount2++;} |
|
|
|
spinner2.update({text: `${chalk.gray('[PROC]')} >> ${chalk.blueBright(`Cached`)} ${chalk.white(`${amount2}`)} ${chalk.blueBright(`user blacklists.`)}`}); |
|
|
|
spinner2.update({text: `${chalk.gray('[PROC]')} >> ${chalk.blueBright(`Cached`)} ${chalk.white(`${amount2}`)} ${chalk.blueBright(`user blacklists.`)}`}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
spinner2.update({text: `${chalk.gray('[PROC]')} >> ${chalk.blueBright(`Cached`)} ${chalk.white(`${amount2}`)} ${chalk.blueBright(`user blacklists.`)}`}); |
|
|
|
spinner2.update({text: `${chalk.gray('[PROC]')} >> ${chalk.blueBright(`Cached`)} ${chalk.white(`${amount2}`)} ${chalk.blueBright(`user blacklists.`)}`}); |
|
|
|
|
|
|
|
const cacheTime2 = new Date().getTime() - st2; |
|
|
|
|
|
|
|
spinner2.update({text: `${spinner2.options.text.slice(0, 19).trim()} ${chalk.gray(`${cacheTime2}ms >>`.padStart(8, '0').padStart(7, '0'))} ${spinner2.options.text.slice(19).trim()}`}); |
|
|
|
spinner2.status('non-spinnable'); |
|
|
|
spinner2.status('non-spinnable'); |
|
|
|
|
|
|
|
|
|
|
|
resolve(0); |
|
|
|
resolve(0); |
|
|
|