mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2024-12-23 00:03:09 +02:00
chore: remove bad upgrade code
This commit is contained in:
parent
46bab4daed
commit
678e9413a6
@ -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
|
||||
|
@ -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();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
Loading…
Reference in New Issue
Block a user