mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-02-24 10:13:58 +00:00
@@ -19,44 +19,6 @@ A docker image's export path is in /a, to export the file to host use:
|
||||
|
||||
$ docker run -v $PWD:/a tyrrrz/discordchatexporter export -t TOKEN -c CHANNEL
|
||||
|
||||
#
|
||||
|
||||
A script to export every channel you're on:
|
||||
```
|
||||
#!/bin/bash
|
||||
# Info: https://github.com/Tyrrrz/DiscordChatExporter/wiki
|
||||
MY_TOKEN_ID=<TOKEN>
|
||||
TOKENTYPE=<BOT/USER>
|
||||
|
||||
if [[ "$TOKENTYPE" == "BOT" ]]; then
|
||||
ISBOTYES=-b
|
||||
fi
|
||||
|
||||
# get list of guilds
|
||||
guilds=$(docker run --rm -v $PWD:/a tyrrrz/discordchatexporter guilds -t $MY_TOKEN_ID $ISBOTYES | tr -d '[:blank:]')
|
||||
|
||||
for guild in $guilds; do
|
||||
guild_id=$(echo $guild | cut -d '|' -f 1)
|
||||
guild_name=$(echo $guild | cut -d '|' -f 2)
|
||||
echo "Guild: $guild_name - $guild_id"
|
||||
|
||||
channels=$(docker run --rm -v $PWD:/a tyrrrz/discordchatexporter channels -t $MY_TOKEN_ID $ISBOTYES -g $guild_id | tr -d '[:blank:]')
|
||||
for channel in $channels; do
|
||||
channel_id=$(echo $channel | cut -d '|' -f 1)
|
||||
channel_name=$(echo $channel | cut -d '|' -f 2)
|
||||
|
||||
echo "Channel: $channel_name - $channel_id at $guild_name"
|
||||
result=$(docker run --rm -v $PWD:/a tyrrrz/discordchatexporter export -t $MY_TOKEN_ID $ISBOTYES -c $channel_id -o /a/${guild_name}_${channel_name}.html)
|
||||
if [ ! $? ]; then
|
||||
echo "Something went wrong:"
|
||||
echo "$result"
|
||||
exit
|
||||
else
|
||||
echo "File saved as ${guild_name}_${channel_name}.html"
|
||||
fi
|
||||
done
|
||||
done
|
||||
exit
|
||||
```
|
||||
##
|
||||
Special thanks to [@simnalamburt](https://github.com/simnalamburt) (Dockerize) and [@shlagevuk](https://github.com/shlagevuk) (Script)
|
||||
Special thanks to [@simnalamburt](https://github.com/simnalamburt) (Dockerize) and [@shlagevuk](https://github.com/shlagevuk) (Legacy Script)
|
||||
Reference in New Issue
Block a user