Skip to content

Commit

Permalink
✨ Upgrade to new Discord data packages format
Browse files Browse the repository at this point in the history
  • Loading branch information
Androz2091 committed Jun 13, 2021
1 parent 8bf3ba4 commit 1666871
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/app/extractor.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,16 +167,16 @@ export const extractData = async (files) => {
loadTask.set('Loading user messages...');

const messagesIndex = JSON.parse(await readFile('messages/index.json'));
const messagesPathRegex = /messages\/([0-9]{16,32})\/$/;
const messagesPathRegex = /messages\/c([0-9]{16,32})\/$/;
const channelsIDs = files.filter((file) => messagesPathRegex.test(file.name)).map((file) => file.name.match(messagesPathRegex)[1]);

let messagesRead = 0;

await Promise.all(channelsIDs.map((channelID) => {
return new Promise((resolve) => {

const channelDataPath = `messages/${channelID}/channel.json`;
const channelMessagesPath = `messages/${channelID}/messages.csv`;
const channelDataPath = `messages/c${channelID}/channel.json`;
const channelMessagesPath = `messages/c${channelID}/messages.csv`;

Promise.all([
readFile(channelDataPath),
Expand Down

0 comments on commit 1666871

Please sign in to comment.