diff --git a/discord/README.md b/discord/README.md new file mode 100644 index 0000000..b80ea38 --- /dev/null +++ b/discord/README.md @@ -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 +``` diff --git a/discord/export.sh b/discord/export.sh new file mode 100755 index 0000000..017d0b1 --- /dev/null +++ b/discord/export.sh @@ -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