Discord Messages Dumper
It's a simple script to dump all your messages from Discord into a plain JSON.
-
Go to Privacy & Safety on your Discord's user settings.
-
Scroll all the way down and find the blue "Request Data" button and click it.
-
Wait for a few days until you receive
package.zip
from Discord in your email (it takes a very long time, depending on how many messages you've sent, selecting more fields will take it even longer)
- Download this repository and extract it or run
git clone https://github.com/RuriYS/DCMD.git
- Download
package.zip
if you haven't already from the email Discord sent - Copy
messages
folder intoDCMD
- Configure your filters in
config.json
:
{
"messages_path": "messages",
"filters": {
"links": false, // Remove messages with URLs
"emojis": false, // Remove messages with emojis
"commands": true, // Remove messages starting with command prefixes
"words": false, // Remove messages containing filtered words
"multilines": false, // Remove messages with multiple lines
"duplicates": true, // Remove duplicate messages
"numbers": false // Remove messages containing only numbers
},
"length": {
"min": 1, // Minimum token count
"max": null // Maximum token count (null for unlimited)
},
"limit": null, // Maximum messages to dump (null for unlimited)
"output": ["json", "txt"], // Generate both formats
"command_prefixes": ["$", "%", "!", ".", "#", "<a:"], // Command prefixes to filter
"filtered_words": ["\n", "**", "<@", "<#", "`", "://"], // Words to filter
"channels": {
"whitelist": [], // Only include these channel IDs (if empty, use blacklist)
"blacklist": [] // Ignore these channel IDs
},
"guilds": {
"whitelist": [], // Only include these guild names (if empty, use blacklist)
"blacklist": ["A certain guild"] // Ignore these guild names
},
"ignore_dms": false // Set to true to ignore all DMs
}
- Run the script:
python main.py
- Filtered messages will be saved to
dump.json
:
[
{
"channel_id": "990518804062810133",
"channel_name": "general",
"guild_name": "DM or Guild Name",
"messages": [
"message", ...
]
}, ...
]
The script supports two output formats, configurable via the output
option in config.json
:
json
: Messages organized by channel ID in a JSON file (dump.json)txt
: Messages in a flat text file, one per line (dump.txt)
- Channel Filtering:
- Use whitelist to only include specific channels
- Use blacklist to exclude specific channels
- If whitelist is not empty, only whitelisted channels are included
- If whitelist is empty but blacklist is populated, all channels except blacklisted ones are included
- If both are empty, all channels are included
- Guild Filtering:
- Same whitelist/blacklist logic as channels but applies to guild names
- DM Filtering: Set
ignore_dms
totrue
to skip all direct messages
- Links: Remove messages containing URLs
- Emojis: Remove messages containing emoji
- Commands: Remove messages starting with command prefixes
- Words: Remove messages containing any filtered words
- Multilines: Remove messages containing multiple lines
- Numbers: Remove messages containing only numbers
- Duplicates: Remove duplicate messages across all channels
- Minimum Length: Set minimum token count per message
- Maximum Length: Set maximum token count per message (null for no limit)
- Message Limit: Set maximum number of messages to dump (null for no limit)