Created
October 26, 2025 21:00
-
-
Save meowabyte/d053508c94b7af804c314e9eebc9aaab to your computer and use it in GitHub Desktop.
Simple script for preparing "CHANNEL_ID/MESSAGE_ID" formatted file out of Discord package. Just for support removal purposes
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 characters
| 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") | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment