| Crates.io | Dimport |
| lib.rs | Dimport |
| version | 2025.9.21 |
| created_at | 2025-09-20 16:11:25.671811+00 |
| updated_at | 2025-09-21 12:26:34.970122+00 |
| description | Imports messages from JSON files generated by DiscordChatExporter and replaces expired links with media files downloaded by Dimage. |
| homepage | |
| repository | https://github.com/Inc44/Dimport |
| max_upload_size | |
| id | 1847902 |
| size | 327,094 |
Imports messages from JSON files generated by DiscordChatExporter and replaces expired links with media files downloaded by Dimage.
Discord doesn't allow sending messages and embeds from user accounts, so all imported messages are sent from the name of a Discord bot. This program tries to mimic real messages as much as possible using a variety of different options, so good luck.
cargo install dimport
git clone https://github.com/Inc44/Dimport.git
cd Dimport
cargo build --release
cargo publish
Create a .env file or set environment variables.
DISCORD_TOKEN=your_bot_token
cargo run --release
/import "<export.json>" "<media_root>"
/cancel
/help
| Argument | Description |
|---|---|
<json_path> |
Path to the DiscordChatExporter JSON file (required) |
<media_path> |
Path to the directory containing downloaded media files (optional) |
--no-guild |
Hide guild/server name from message footer |
--no-category |
Hide category name from message footer |
--no-channel |
Hide channel name from message footer |
--no-timestamp |
Hide message timestamps |
--no-mentions |
Skip converting @mentions to clickable Discord mentions |
--no-reactions |
Skip importing reactions entirely |
--no-embed |
Skip creating embeds (only works with --outside) |
--button |
Display reactions as interactive buttons instead of native Discord reactions |
--reaction-users |
Show detailed list of users who reacted to each message |
--outside |
Send metadata embed separately from attachments |
--disable-button |
Make reaction buttons unclickable (only works with --button) |
--accent-color |
Use user accent color for embed color instead of exported role color |
--current-avatar |
Use the user's current Discord avatar as author icon |
--range <start,end> |
Import messages within specified range (zero-indexed) |
--range-start <n> |
Set starting message index for import range |
--range-end <n> |
Set ending message index for import range |
--first <n> |
Import only the first N messages |
--last <n> |
Import only the last N messages |
--ephemeral |
Hide messages of /cancel and /help |
DiscordChatExporter supports only exporting. Discord-Chat-Importer has been inactive for over two years and does not support link expiration introduced in late 2023. After creating the original version of Dimage in February 2025 and updating it recently, I decided to build a new alternative from scratch in Rust. It is inspired by Discord-Chat-Importer in response style but includes new features and improved performance.
Discord supports a maximum of 4 images per embed (PC only, 1 for other devices), not fixable yet. More details:
Discord opens the browser when clicking on a user handle instead of doing the same inside Discord, not fixable yet. More details:
set_var of dotenvy is unsafe under the Rust 2024 edition. More details:
There is an edge case that makes the original message disappear when 11 buttons are added via --button; this does not happen by default when normal reactions are used.
Cancel may not work if there are multiple imports in the same channel.
Replies are randomly marked. A possible solution is to add an option to reply as an embed to make them consistent.
Discord bots can't react with the same emoji types multiple times to the message, so for mimicking multiple reactions, you can use --button. However, Discord does not support changing button text on click natively, so the button's reaction count doesn't change. Also, to avoid getting "Button interaction failed," you can freeze/disable buttons to make them unclickable using --disable-button, which unfortunately makes them grayed out. If you do not want to import reactions, you can use --no-reactions. So, good luck choosing your poison.
/import can't be registered as a slash command because it has too many flags or options, and it makes the bot send separate messages instead of one stream. Therefore, its output cannot be ephemeral. Embeds are not suppressed for /help when ephemeral is used, probably because they disappear anyway.
<json_path> can be a link, either Google Drive download type https://drive.usercontent.google.com/download?id=... or GitHub raw type https://raw.githubusercontent.com/user/repo/refs/heads/master/.... However, other websites may not work for unknown reasons, like some temporary clipboards https://nopaste.net/....
Emojis that do not belong to the server are not visible.
Content like embeds or polls is not imported.
Creators of:
People:
Contributions, suggestions, and new ideas are heartily welcomed. If you're considering significant modifications, please initiate an issue for discussion before submitting a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.