legacyMigrator: possible fix for last commit
parent
a76a675f4c
commit
8a1b8802b3
|
@ -69,9 +69,11 @@ async function shouldMigrate() {
|
||||||
|
|
||||||
async function migrateOpenThreads() {
|
async function migrateOpenThreads() {
|
||||||
const bot = new Eris.Client(config.token);
|
const bot = new Eris.Client(config.token);
|
||||||
await bot.connect();
|
|
||||||
|
|
||||||
|
return new Promise(resolve => {
|
||||||
|
bot.on('ready', async () => {
|
||||||
const oldThreads = await jsonDb.get('threads', []);
|
const oldThreads = await jsonDb.get('threads', []);
|
||||||
|
|
||||||
const promises = oldThreads.map(async oldThread => {
|
const promises = oldThreads.map(async oldThread => {
|
||||||
const existingOpenThread = await knex('threads')
|
const existingOpenThread = await knex('threads')
|
||||||
.where('channel_id', oldThread.channelId)
|
.where('channel_id', oldThread.channelId)
|
||||||
|
@ -106,7 +108,11 @@ async function migrateOpenThreads() {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
return Promise.all(promises);
|
resolve(Promise.all(promises));
|
||||||
|
});
|
||||||
|
|
||||||
|
bot.connect();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async function migrateLogs() {
|
async function migrateLogs() {
|
||||||
|
|
Loading…
Reference in New Issue