Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Sciencentistguy/discord-channel-archiver
A discord bot to archive the messages in a discord text channel.
https://github.com/Sciencentistguy/discord-channel-archiver
archival discord exporter json rust
Last synced: 16 days ago
JSON representation
A discord bot to archive the messages in a discord text channel.
- Host: GitHub
- URL: https://github.com/Sciencentistguy/discord-channel-archiver
- Owner: Sciencentistguy
- License: other
- Created: 2021-01-18T13:05:23.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2024-04-05T17:38:20.000Z (9 months ago)
- Last Synced: 2024-04-05T18:39:25.877Z (9 months ago)
- Topics: archival, discord, exporter, json, rust
- Language: Rust
- Homepage:
- Size: 521 KB
- Stars: 36
- Watchers: 3
- Forks: 1
- Open Issues: 13
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# discord-channel-archiver
A discord bot to archive the messages in a discord text channel.
## Usage
- [Create](https://discordpy.readthedocs.io/en/latest/discord.html#creating-a-bot-account) 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](https://discordpy.readthedocs.io/en/latest/discord.html#inviting-your-bot) 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:
- With nix:
- `nix run github:Sciencentistguy/discord-channel-archiver -- [output_directory]`
- With cargo:
- `cargo run -- [output_directory]`
- Standalone:
- `discord-channel-archiver [output_directory]`
- The commands `/archive` and `/archive_emoji` should be available in your guilds.
- Alternatively, send a message of the form:
- `!archive [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.
- `!archive_emoji`
- 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 should 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](https://github.com/serde-rs/json). If prettier fails to parse the output, this is likely a bug, please file an issue.
## Stability
There is no stability guarantee for the generate files. Discord's API can change, and therefore this program must also allow the outputted data to change.
---
Inspired by [DiscordChatExporter](https://github.com/Tyrrrz/DiscordChatExporter).
The HTML / CSS templates are derived from the ones from [DiscordChatExporter](https://github.com/Tyrrrz/DiscordChatExporter), under the terms of the GNU GPL.
For licence information, see [licence.md](licence.md).