chore: remove bad upgrade code

This commit is contained in:
Isaac 2021-10-07 13:59:54 +01:00
parent 46bab4daed
commit 678e9413a6
No known key found for this signature in database
GPG Key ID: 87B9B6BD04EB7534
2 changed files with 0 additions and 30 deletions

View File

@ -162,7 +162,6 @@ class Bot extends Client {
this.setMaxListeners(this.config.max_listeners); // set the max listeners for each event
require('./update/notifier')(this); // check for updates
require('./update/upgrade')(this); // upgrade
const listeners = new ListenerLoader(this);
listeners.load(); // load listeners

View File

@ -1,29 +0,0 @@
const fs = require('fs');
const { path } = require('../utils/fs');
const FILE = path('./version');
const { version: current } = require('../../package.json');
/**
* @param {import('../..').Bot} client
*/
module.exports = async client => {
if (!fs.existsSync(FILE)) {
return fs.writeFileSync(FILE, current);
} else {
const previous = fs.readFileSync(FILE, { encoding: 'utf8' });
if (previous !== current) {
client.log.info('Running upgrade task');
client.log.info('Writing version');
fs.writeFileSync(FILE, current);
const guilds = await client.db.models.Guild.findAll();
guilds.forEach(async guild => {
guild.set('blacklist', {
members: [],
roles: []
});
await guild.save();
});
}
}
};