add way to export Discord server

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2020-04-07 13:43:38 +02:00
parent 1a9e735031
commit 9f0aa6abaa
No known key found for this signature in database
GPG Key ID: 4EF064D0E6D63020
2 changed files with 41 additions and 0 deletions

20
discord/README.md Normal file
View File

@ -0,0 +1,20 @@
# Description
This script is an example of how a Discord Server can be exported in its entirety.
This script is using the `tyrrrz/discordchatexporter` Docker image of [DiscordChatExporter](https://github.com/Tyrrrz/DiscordChatExporter).
# Usage
```sh
export API_TOKEN=abcd
export GUILD_ID=1234
./export.sh
```
# Instructions
You can get instructions on getting the necessary values by running:
```sh
docker run --rm -it tyrrrz/discordchatexporter guide
```

21
discord/export.sh Executable file
View File

@ -0,0 +1,21 @@
#!/usr/bin/env bash
set -e
if [[ -z "$API_TOKEN" ]]; then
echo "The API_TOKEN env variable is not set"
exit 1
fi
if [[ -z "$GUILD_ID" ]]; then
echo "The GUILD_ID env variable is not set"
exit 1
fi
docker run --rm -it -v "$PWD:/export" \
tyrrrz/discordchatexporter \
exportguild --bot \
--token "$API_TOKEN" \
--guild "$GUILD_ID" \
--output "/export" \
--format HtmlDark