{"id":21477548,"url":"https://github.com/5ht2/discord-mass-delete","last_synced_at":"2026-03-06T18:45:18.197Z","repository":{"id":108778981,"uuid":"412888273","full_name":"5HT2/discord-mass-delete","owner":"5HT2","description":"A lightweight way to mass delete old messages","archived":false,"fork":false,"pushed_at":"2024-03-20T07:12:01.000Z","size":51,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-05-20T22:42:21.526Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/5HT2.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2021-10-02T19:05:10.000Z","updated_at":"2024-02-22T22:30:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"f10a61fd-d370-40ed-bb96-303b6dec9cfa","html_url":"https://github.com/5HT2/discord-mass-delete","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5HT2%2Fdiscord-mass-delete","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5HT2%2Fdiscord-mass-delete/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5HT2%2Fdiscord-mass-delete/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5HT2%2Fdiscord-mass-delete/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/5HT2","download_url":"https://codeload.github.com/5HT2/discord-mass-delete/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226033243,"owners_count":17563126,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-23T11:14:14.750Z","updated_at":"2025-10-25T17:31:47.336Z","avatar_url":"https://github.com/5HT2.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# discord-mass-delete\n\nA quick tool to retroactively delete all messages (or filter to specific channels / guilds), extracted from your Discord data request, or\nfrom search results.\n\nDiscord has now fixed their GDPR violations (which I reported to them) since\nthe [2022/11/10 GDPR fine](https://edpb.europa.eu/news/national-news/2023/french-sa-fines-discord-eur-800000_en).\n\n\u003cdetails\u003e\n    \u003csummary\u003e\n        Old disclaimer about Discord data requests.\n    \u003c/summary\u003e\n\n**DISCLAIMER:** It wasn't until recently that I discovered that Discord has decided to not include messages from servers you are not\ncurrently in, inside your Discord data request. This contradicts what\ntheir [support article](https://support.discord.com/hc/en-us/articles/360004957991) says and is likely a GDPR violation, given your messages\nstill exist and are accessible when you leave a server.\n\nThe data request, however, still does include all DMs that you have sent a message in or opened, as far as I can tell. I have an opened\nticket (#17970549) in a special channel I was given specifically for these issues, but I have not been given any response since 2021/11/05,\nafter noting that it was likely a GDPR violation.\n\nDiscord has **ignored** further requests to contact them about this matter and has not fixed this issue. This will likely continue to be an\nissue until somebody makes an official GDPR complaint.\n\n\u003c/details\u003e\n\n## Usage\n\n```bash\ngit clone git@github.com:5HT2/discord-mass-delete.git\ncd discord-mass-delete\nmake\n./mass-delete -h # Run the program with help arguments\n```\n\n## Running\n\n1. Download your Discord data backup. You can get this by going to Discord Settings \u003e Privacy \u0026 safety \u003e Request all of my data\n2. Extract the data somewhere. Doesn't matter.\n3. Follow the above [usage](#Usage) instructions and run the program from anywhere.\n4. Follow the interactive instructions. You can use the `-dir $DISCORD_DIR -dirconfirm` args with `DISCORD_DIR` set to a path to skip the\n   prompts.\n   The `-bottoken` arg is the only required argument. `-channels` is a comma separated list of channel IDs.\n\nExample:\n\n```bash\n./mass-delete -dirconfirm -dir \"$DISCORD_DIR\" -channels \"$DISCORD_CHANNELS\" -bottoken \"$DISCORD_BOT_TOKEN\"\n```\n\n## `.env`\n\nYou can also use a `.env` file for flags. Use the following format:\n\n```dotenv\nDISCORD_BOT_TOKEN=\"YOUR BOT TOKEN GOES HERE\"\nDISCORD_DIR=\"/path/to/package/messages\"\nDISCORD_CHANNELS=\"some_numbers,other_numbers\"\nDISCORD_GUILDS=\"some_guild_id\"\nDISCORD_AUTHORS=\"some_other_numbers,more_numbers\"\n```\n\n#### Filtering\n\nThere are two possible filter flags: `-channels` and `-guilds`. Both are comma separated lists of IDs. There is also a `-authors` flag for\nusing search results.\n\nThe channels filter takes precedence over guilds.\nFor example, if you specify a channels filter and a channel is not found in the list, it will be skipped.\nIf you specify a guilds filter and a channel is not inside one of the specified guilds, it will also be skipped, regardless of the channel\nsetting.\n\nIt is not necessary to use both options if you want to select specific channels inside a guild, as supplying the channels is good enough.\n\n#### Search results\n\nYou can also use the search results to delete from, instead of a Discord data request.\n\n1. To do so, open the Chrome Dev Tools with \u003ckbd\u003eCtrl\u003c/kbd\u003e \u003ckbd\u003eShift\u003c/kbd\u003e \u003ckbd\u003eI\u003c/kbd\u003e, go to the network tab.\n2. Now, make a search, and click through all the pages you would like to use.\n3. Open a new Dev Tools window for your existing Dev Tools window with \u003ckbd\u003eCtrl\u003c/kbd\u003e \u003ckbd\u003eShift\u003c/kbd\u003e \u003ckbd\u003eI\u003c/kbd\u003e (yes, debug inception).\n4. Run the following in the console tab (taken from [StackOverflow](https://stackoverflow.com/a/57782978), works on Chrome 111 or newer):\n\n```javascript\nawait (async () =\u003e {\n  const getContent = r =\u003e r.url() \u0026\u0026 !r.url().startsWith('data:') \u0026\u0026 r.contentData();\n  const nodes = UI.panels.network.networkLogView.dataGrid.rootNode().flatChildren();\n  const requests = nodes.map(n =\u003e n.request());\n  const contents = await Promise.all(requests.map(getContent));\n  return contents.map((data, i) =\u003e {\n    const r = requests[i];\n    const url = r.url();\n    const body = data?.content;\n    const content = !data ? url :\n        r.contentType().isTextType() ? data :\n            typeof body !== 'string' ? body :\n                `data:${r.mimeType}${data.encoded ? ';base64' : ''},${body}`;\n    return { url, content };\n  });\n})();\n```\n\n5. Right-click the given result, and select `Copy object`.\n6. Paste this to a new `.json` file in the directory that you give the mass delete program.\n\nRun example:\n\n```bash\n./mass-delete -dirconfirm -dir \"$DISCORD_DIR\" -usesearch -authors \"$DISCORD_AUTHORS\"\n```\n\n#### Using a user account instead of a bot account\n\nThis program respects Discord's rate limits, so while it *is* against Discord TOS, you can't really get banned for using it (use user tokens\nat your own risk, I am not liable).\n\nThe first step is required for it to work.\nEverything afterward is only something you should do if you are paranoid about your account getting banned.\n\n- Use `-usertoken` instead of `-bottoken`, or `DISCORD_USER_TOKEN` instead of `DISCORD_BOT_TOKEN`.\n- Add the regular headers that you would get from deleting a message.\n    - Press \u003ckbd\u003eCtrl\u003c/kbd\u003e \u003ckbd\u003eShift\u003c/kbd\u003e \u003ckbd\u003eI\u003c/kbd\u003e\n    - Go to the Network tab\n    - Delete a message\n    - Hit the last request (usually status 204, make sure the Request Method is `DELETE`)\n    - Go to Headers\n    - Scroll down to Request Headers\n    - Add a line that looks like `req.Header.Set(\"header name\", \"request value\")`, for each header\n    - Now you can follow the [Usage](#Usage) instructions. Use your user token with the `-bottoken` arg.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F5ht2%2Fdiscord-mass-delete","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F5ht2%2Fdiscord-mass-delete","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F5ht2%2Fdiscord-mass-delete/lists"}