Skip to content

Instantly share code, notes, and snippets.

@meowabyte
Created October 26, 2025 21:00
Show Gist options
  • Select an option

  • Save meowabyte/d053508c94b7af804c314e9eebc9aaab to your computer and use it in GitHub Desktop.

Select an option

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
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