MCPcopy Index your code
hub / github.com/Sciencentistguy/discord-channel-archiver

github.com/Sciencentistguy/discord-channel-archiver @0.3.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.3.0 ↗ · + Follow
30 symbols 44 edges 6 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

discord-channel-archiver

A discord bot to archive the messages in a discord text channel.

Usage

  • Create a discord application and bot.
  • Enable the Server Members privileged intent for your bot. Note that this means your bot cannot be in more than 100 servers without verification. For a bot of this type, where the output is saved to the disk of the computer running it, this should not be a problem.
  • Invite the bot to your server. Make sure to select the application.commands scope if you want to use slash commands.
  • Run the bot, providing the token and application id as command line arguments:
  • Either with cargo:
    • cargo run -- <token_filename> <application_id_filename>
  • Or standalone:
    • discord-channel-archiver <token_filename> <application_id_filename>
  • The commands /archive and /archive_emoji should be available in your guilds.
  • Alternatively, send a message of the form:
  • !archive_emoji
  • !archive <channel> [mode], where channel is the channel you want to archive, and mode is one of either json or html. If this is blank, or if is any other value, all output formats will be generated.
  • 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 doing this if the resultant HTML is to be stored for archival purposes. The JSON should be clean as it is generated by serde.


Inspired by DiscordChatExporter.

The HTML / CSS templates are derived from the ones from DiscordChatExporter, under the terms of the GNU GPL.

For licence information, see licence.md.

Core symbols most depended-on inside this repo

strip_html_newlines
called by 5
src/html.rs
get_member_cached
called by 3
src/html.rs
archive
called by 2
src/main.rs
write_html
called by 2
src/html.rs
write_json
called by 2
src/json.rs
archive_emoji
called by 2
src/emoji.rs
download_url
called by 1
src/file.rs
get_username_cached
called by 1
src/html.rs

Shape

Method 10
Class 9
Function 9
Enum 2

Languages

Rust100%

Modules by API surface

src/html.rs11 symbols
src/main.rs10 symbols
src/json.rs6 symbols
src/file.rs1 symbols
src/error.rs1 symbols
src/emoji.rs1 symbols

For agents

$ claude mcp add discord-channel-archiver \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page