discord-channel-archiver
A small discord bot to archive the messages in a discord text channel.
This is still WIP. The HTML and JSON modes are vaguely complete, but they may still change in the future.
Usage
- Edit
src/main.rs
and change the value of the constantOUTPUT_DIRECTORY
to your desired download location. - Create a discord application and bot.
- Invite the bot to your server.
- Run the bot with
cargo run
. To provide the token, you have 3 options:- Provide the token directly with
--token <token>
- Provide the name of a file containing the token with
--token-filename <filename>
- Set the environment variable
DISCORD_TOKEN
to the token before running.
- Provide the token directly with
- Send the command
!archive <channel> [mode(s)]
, where<channel>
is the channel you want to archive, and[mode(s)]
is a possibly comma-separated list of modes. Valid modes are:json,html
. All modes are enabled if this parameter is omitted. - Sit back and watch the bot export the channel to the file format(s) you requested.
The HTML generated is very messy, but it should be well-formed. This means that an html formatter such as prettier may be used to clean it up. I'd recommend this for archival purposes. The JSON should be clean as it is generated by serde.
Incomplete features
I have some planned features that I am yet to finish (or even start) implementing:
- HTML output, similar to discord's own interface .
- Dark mode and Light mode support
- YAML output.
Based on Serenity.
Inspired by this similar program.
The HTML / CSS templates are derived from the ones from DiscordChatExporter, under the terms of the GNU GPL.
Available under the terms of the GNU AGPL.