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

Overview

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.

Comments
  • Update Rust crate once_cell to 1.17.0

    Update Rust crate once_cell to 1.17.0

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | once_cell | dependencies | minor | 1.16.0 -> 1.17.0 |


    Release Notes

    matklad/once_cell

    v1.17.0

    Compare Source

    • Add race::OnceRef for storing a &'a T.

    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Enabled.

    â™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update Rust crate serde to 1.0.152

    Update Rust crate serde to 1.0.152

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | serde (source) | dependencies | patch | 1.0.151 -> 1.0.152 |


    Release Notes

    serde-rs/serde

    v1.0.152

    Compare Source

    • Documentation improvements

    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Enabled.

    â™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update Rust crate clap to 4.0.32

    Update Rust crate clap to 4.0.32

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | clap | dependencies | patch | 4.0.30 -> 4.0.32 |


    Release Notes

    clap-rs/clap

    v4.0.32

    Compare Source

    Fixes
    • (parser) When overriding required(true), consider args that conflict with its group

    v4.0.31

    Compare Source

    Performance
    • Speed up parsing when a lot of different flags are present (100 unique flags)

    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Enabled.

    â™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update Rust crate clap to 4.0.30

    Update Rust crate clap to 4.0.30

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | clap | dependencies | patch | 4.0.29 -> 4.0.30 |


    Release Notes

    clap-rs/clap

    v4.0.30

    Compare Source

    Fixes
    • (error) Improve error for args_conflicts_with_subcommand

    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Enabled.

    â™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update Rust crate serde_json to 1.0.91

    Update Rust crate serde_json to 1.0.91

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | serde_json | dependencies | patch | 1.0.90 -> 1.0.91 |


    Release Notes

    serde-rs/json

    v1.0.91

    Compare Source


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Enabled.

    â™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update Rust crate thiserror to 1.0.38

    Update Rust crate thiserror to 1.0.38

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | thiserror | dependencies | patch | 1.0.37 -> 1.0.38 |


    Release Notes

    dtolnay/thiserror

    v1.0.38

    Compare Source

    • Documentation improvements

    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Enabled.

    â™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update Rust crate serde_json to 1.0.90

    Update Rust crate serde_json to 1.0.90

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | serde_json | dependencies | patch | 1.0.89 -> 1.0.90 |


    Release Notes

    serde-rs/json

    v1.0.90

    Compare Source

    • Documentation improvements

    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Enabled.

    â™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update Rust crate indoc to 1.0.8

    Update Rust crate indoc to 1.0.8

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | indoc | dependencies | patch | 1.0.7 -> 1.0.8 |


    Release Notes

    dtolnay/indoc

    v1.0.8

    Compare Source

    • Documentation improvements

    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Enabled.

    â™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update Rust crate serde to 1.0.151

    Update Rust crate serde to 1.0.151

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | serde (source) | dependencies | patch | 1.0.150 -> 1.0.151 |


    Release Notes

    serde-rs/serde

    v1.0.151

    Compare Source

    • Update serde::{ser,de}::StdError to re-export core::error::Error when serde is built with feature="std" off and feature="unstable" on (#​2344)

    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Enabled.

    â™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update Rust crate serde to 1.0.150

    Update Rust crate serde to 1.0.150

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | serde (source) | dependencies | patch | 1.0.149 -> 1.0.150 |


    Release Notes

    serde-rs/serde

    v1.0.150

    Compare Source

    • Relax some trait bounds from the Serialize impl of HashMap and BTreeMap (#​2334)
    • Enable Serialize and Deserialize impls of std::sync::atomic types on more platforms (#​2337, thanks @​badboy)

    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Enabled.

    â™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update Rust crate tokio to 1.23.0

    Update Rust crate tokio to 1.23.0

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | tokio (source) | dependencies | minor | 1.22.0 -> 1.23.0 |


    Release Notes

    tokio-rs/tokio

    v1.23.0: Tokio v1.23.0

    Compare Source

    Fixed
    Changed
    • runtime: yield_now defers task until after driver poll (#​5223)
    • runtime: reduce amount of codegen needed per spawned task (#​5213)
    • windows: replace winapi dependency with windows-sys (#​5204)

    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Enabled.

    â™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Dependency Dashboard

    Dependency Dashboard

    This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

    This repository currently has no open or pending branches.

    Detected dependencies

    cargo
    Cargo.toml
    • chrono 0.4.23
    • futures 0.3.25
    • regex 1.7.0
    • reqwest 0.11.13
    • serde 1.0.152
    • serde_json 1.0.91
    • clap 4.0.32
    • tokio 1.23.0
    • once_cell 1.17.0
    • liquid 0.26.0
    • thiserror 1.0.38
    • tracing 0.1.37
    • tracing-subscriber 0.3.16
    • indoc 1.0.8
    • serenity 0.11.5
    circleci
    .circleci/config.yml
    • rust 1.6.0

    • [ ] Check this box to trigger a request for Renovate to run again on this repository
    opened by renovate[bot] 0
  • Add option to use discord's new styling

    Add option to use discord's new styling

    Discord has changed its styling (https://github.com/Discord-Datamining/Discord-Datamining/commit/ced5f5bb16cdf0e736d00b8bcf06722db62eac30) and I think this should be a config option for the html generation.

    enhancement help wanted 
    opened by Sciencentistguy 0
Owner
Jamie Quigley
Computer science student at the University of York.
Jamie Quigley
Remote-Archive is a utility for exploring remote archive files without downloading the entire contents of the archive.

[WIP] REMOTE-ARCHIVE Remote-Archive is a utility for exploring remote archive files without downloading the entire contents of the archive. The idea b

null 4 Nov 7, 2022
A simple Telegram bot that eats anonymous channel messages, written in Rust.

tgbot-nochanmsg By Asuna Right Control When creating your bot from botfather, it's not bad to disable privacy mode, because it needs to access the mes

h3a.moe 2 Aug 5, 2022
archive-rs provides a generic way of dealing with multiple archive and compression formats in Rust

archive-rs A Rust crate that aims to provide a generic way of dealing with multiple archive and compression formats by providing a generic abstraction

S.J.R. van Schaik 2 Nov 21, 2021
musify is a simple discord bot to play music within a voice channel, written in the rust programming language.

musify-rs musify is a simple discord bot to play music within a voice channel, written in the rust programming language. Features A simple song queue

NV6 5 Aug 14, 2022
Expand threaded messages without "Also sent to the channel"

slack-thread-expander Expand threaded messages without "Also sent to the channel" Usage Setup Slack App Create a Slack App for slack-thread-expander.

Kohei Suzuki 7 Feb 15, 2022
WriteForAll is a text file style checker, that compares text documents with editorial tips to make text better.

WriteForAll: tips to make text better WriteForAll is a text file style checker, that compares text documents with editorial tips to make text better.

Joel Parker Henderson 2 Dec 27, 2022
Rewrite of the Discord Bot used for Managing the Infinity Bot List Servers.

Arcadia Rewrite of the Discord Bot used for Managing the Infinity Bot List Servers. Contributing Always run fmt.sh before making a Pull Request! MacOS

InfinityBotList 3 Dec 15, 2022
discord bot for uwuifying text

uwubot This crate defines a discord bot using serenity for uwuifying text via uwuify. Installation You can install uwubot from source or from crates.i

Jane Lusby 32 Oct 31, 2021
A small in-house bot of the TTC Discord Server

Welcome to The Terminal cafe Support Bot Repository Hello, hope you are having a nice day. This is the official repository for The Terminal Cafe Suppo

null 5 Jul 4, 2022
A Telegram bot synchronizes Telegram messages to Mastodon.

tgbot-mastodon-sync A Telegram bot synchronizes Telegram messages to Mastodon. Official hosted account: @mastodon_sync_bot Self-Host 1. Install binary

Sprite 7 Mar 5, 2023
A Discord bot focused on addressing the inherent problems with Discord, to allow a more socialist/anarchist organization of servers.

ACABot A Discord bot focused on addressing the inherent problems with Discord, to allow a more socialist/anarchist organization of servers (or "guilds

null 4 May 3, 2022
A rust(serenity) based discord bot for the hacksquad discord server

A Discord Bot for Hacksquad How to Deploy? Requirements Docker Docker Compose Steps To Run Copy the docker-compose.yml and .env.example files to your

HackSquad 5 Jan 4, 2023
Small Rust program for sending messages to Telegram channels.

tg-send: a small Rust program for sending Telegram messages Send messages to a group/channel via the Bot API from the command line; it's super simple

null 2 Jul 10, 2023
Push BYCEPS ticket sale stats to Discord (as channel name)

Push BYCEPS Ticket Sale Stats to Discord A tool to fetch ticket sale stats for a specific LAN party from a BYCEPS installation and show that as the na

BYCEPS 1 Dec 28, 2021
🥅 Dead simple webhook worker for Sentry to output events in a Discord channel

?? Sentry Webhook Dead simple webhook worker for Sentry to output events in a Discord channel Why? This is just a simple Rust HTTP service to do so, t

Noel 5 Nov 7, 2022
Matrix bot inspired by Shirt Bot.

matrix-openai-bot Matrix bot inspired by Shirt Bot. Usage Run the bot after building it or grabbing the latest release $ matrix-openai-bot Edit the ge

null 5 Oct 26, 2021
GTK application for browsing and installing fonts from Google's font archive

Font Finder This project is a from-scratch implementation of TypeCatcher in Rust. It is a GTK3 application for browsing through and installing fonts f

Michael Murphy 252 Dec 26, 2022
A HTTP Archive format (HAR) serialization & deserialization library, written in Rust.

har-rs HTTP Archive format (HAR) serialization & deserialization library, written in Rust. Install Add the following to your Cargo.toml file: [depende

Sebastian Mandrean 25 Dec 24, 2022
A CLI application which allows you to archive Urbit channels and all linked content in them.

The Urbit Content Archiver is a small CLI application that exports channels from your Urbit ship and auto-downloads any directly linked content locall

Robert Kornacki 33 Sep 25, 2022
Rust crate which provides direct access to files within a Debian archive

debarchive This Rust crate provides direct access to files within a Debian archive. This crate is used by our debrep utility to generate the Packages

Pop!_OS 11 Dec 18, 2021