mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-04-23 14:33:58 +00:00
Fix code
@@ -21,42 +21,42 @@ A docker image's export path is in /a, to export the file to host use:
|
|||||||
|
|
||||||
#
|
#
|
||||||
|
|
||||||
A script to gather every channel you're on:
|
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>
|
||||||
|
|
||||||
#!/usr/bin/env bash
|
if [[ "$TOKENTYPE" == "BOT" ]]; then
|
||||||
# Info: https://github.com/Tyrrrz/DiscordChatExporter/wiki
|
ISBOTYES=-b
|
||||||
TOKEN=<token>
|
fi
|
||||||
TOKENTYPE=<BOT/USER>
|
|
||||||
|
|
||||||
if [[ "$TOKENTYPE" == "BOT" ]]; then
|
# get list of guilds
|
||||||
ISBOTYES=-b
|
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
|
fi
|
||||||
|
done
|
||||||
guilds=$(docker run --rm -v $PWD:/a tyrrrz/discordchatexporter guilds -t $TOKEN $ISBOTYES | tr -d '[:blank:]')
|
done
|
||||||
|
exit
|
||||||
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 $TOKEN $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"
|
|
||||||
echo "Guild: $guild_name - $guild_id"
|
|
||||||
result=$(docker run --rm -v $PWD:/a tyrrrz/discordchatexporter export -t $TOKEN $ISBOTYES -c $channel_id -o /a/${guild_name}_${channel_name}.html)
|
|
||||||
if [ ! $? ]; then
|
|
||||||
echo "Something went wrong: $result"
|
|
||||||
exit
|
|
||||||
else
|
|
||||||
echo "File saved as ${guild_name}_${channel_name}.html"
|
|
||||||
exit
|
|
||||||
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) (Script)
|
||||||
Reference in New Issue
Block a user