mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-04-04 12:49:04 +00:00
Improved script to be able to handle multiple export tasks at the same directory
@@ -41,23 +41,23 @@ fi
|
||||
|
||||
PATH=/Library/Frameworks/Mono.framework/Versions/Current/bin/:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
|
||||
|
||||
mono DiscordChatExporter.Cli.exe export -t $TOKEN $ISBOTYES -c $CHANNEL -f $EXPORTFORMAT -o export.tmp
|
||||
mono DiscordChatExporter.Cli.exe export -t $TOKEN $ISBOTYES -c $CHANNEL -f $EXPORTFORMAT -o $FILENAME.tmp
|
||||
CURRENTTIME=$(date +"%Y-%m-%d-%H-%M-%S")
|
||||
|
||||
if [[ "$EXPORTFORMAT" == "PlainText" ]]; then
|
||||
mv "export.tmp" "${EXPORTDIRECTORY//\"}/$FILENAME-$CURRENTTIME.txt"
|
||||
mv "$FILENAME.tmp" "${EXPORTDIRECTORY//\"}/$FILENAME-$CURRENTTIME.txt"
|
||||
|
||||
elif [[ "$EXPORTFORMAT" == "HtmlDark" ]] || [[ "$EXPORTFORMAT" == "HtmlLight" ]]; then
|
||||
mv "export.tmp" "${EXPORTDIRECTORY//\"}/$FILENAME-$CURRENTTIME.html"
|
||||
mv "$FILENAME.tmp" "${EXPORTDIRECTORY//\"}/$FILENAME-$CURRENTTIME.html"
|
||||
|
||||
elif [[ "$EXPORTFORMAT" == "Csv" ]]; then
|
||||
mv "export.tmp" "${EXPORTDIRECTORY//\"}/$FILENAME-$CURRENTTIME.csv"
|
||||
mv "$FILENAME.tmp" "${EXPORTDIRECTORY//\"}/$FILENAME-$CURRENTTIME.csv"
|
||||
else
|
||||
echo "$EXPORTFORMAT - Unknown export format"
|
||||
echo "Available export formats: PlainText, HtmlDark, HtmlLight, Csv"
|
||||
echo "/\ CaSe-SeNsItIvE \/\\"
|
||||
if ! rm -Rf "export.tmp" ;then
|
||||
echo "Unable to delete $PWD/export.tmp"
|
||||
echo "/\ CaSe-SeNsItIvE /\\"
|
||||
if ! rm -Rf "$FILENAME.tmp" ;then
|
||||
echo "Unable to delete $PWD/$FILENAME.tmp"
|
||||
fi
|
||||
exit 1
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user