Created
October 26, 2025 21:00
-
-
Save jakeayy/d053508c94b7af804c314e9eebc9aaab to your computer and use it in GitHub Desktop.
Revisions
-
jakeayy created this gist
Oct 26, 2025 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,26 @@ import { readdirSync, readFileSync, writeFileSync } from "fs" const channelIds = (() => { const files = readdirSync("Messages", { withFileTypes: true }) .filter(x => x.isDirectory() && x.name.startsWith("c")) return files.map(x => x.name.slice(1)) })() const messages = channelIds.reduce((acc, id) => { const str = readFileSync(`Messages/c${id}/messages.json`, "utf-8") const json = JSON.parse(str) acc[id] = json.map(({ ID }) => ID) return acc }, {}) writeFileSync( "messages.txt", Object.entries(messages) .flatMap(([channelId, messageIds]) => messageIds.map(messageId => `${channelId}/${messageId}`) ) .join("\n") )