legacyMigrator: one more fix for that

master
Dragory 2018-02-19 00:50:55 +02:00
parent 8a1b8802b3
commit 8b4f33f199
1 changed files with 4 additions and 1 deletions

View File

@ -81,7 +81,10 @@ async function migrateOpenThreads() {
if (existingOpenThread) return; if (existingOpenThread) return;
const threadMessages = await bot.getChannel(oldThread.channelId).getMessages(1000); const oldChannel = bot.getChannel(oldThread.channelId);
if (! oldChannel) return;
const threadMessages = await oldChannel.getMessages(1000);
const log = threadMessages.reverse().map(msg => { const log = threadMessages.reverse().map(msg => {
const date = moment.utc(msg.timestamp, 'x').format('YYYY-MM-DD HH:mm:ss'); const date = moment.utc(msg.timestamp, 'x').format('YYYY-MM-DD HH:mm:ss');
return `[${date}] ${msg.author.username}#${msg.author.discriminator}: ${msg.content}`; return `[${date}] ${msg.author.username}#${msg.author.discriminator}: ${msg.content}`;