You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Jamie Quigley ca9adb60b3
Sucessful reply no longer puts a double slash in the path
1 hour ago
.idea Refactored message renderer, added channel mention rendering 5 months ago
src Sucessful reply no longer puts a double slash in the path 1 hour ago
.gitignore Add some more timing, reorder rendering to fix some bugs 5 months ago
Cargo.lock Reorder code block code 11 hours ago
Cargo.toml Bump version to 0.2 1 day ago
LICENCE Initial Commit 6 months ago
readme.md Cleaned up embed rendering, and added hover support for mentions 5 months ago
rustfmt.toml Add rustfmt rule to convert use statements to one per line 5 months ago

readme.md

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 constant OUTPUT_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.
  • 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.