mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-05-22 16:55:11 +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
|
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")
|
CURRENTTIME=$(date +"%Y-%m-%d-%H-%M-%S")
|
||||||
|
|
||||||
if [[ "$EXPORTFORMAT" == "PlainText" ]]; then
|
if [[ "$EXPORTFORMAT" == "PlainText" ]]; then
|
||||||
mv "export.tmp" "${EXPORTDIRECTORY//\"}/$FILENAME-$CURRENTTIME.txt"
|
mv "$FILENAME.tmp" "${EXPORTDIRECTORY//\"}/$FILENAME-$CURRENTTIME.txt"
|
||||||
|
|
||||||
elif [[ "$EXPORTFORMAT" == "HtmlDark" ]] || [[ "$EXPORTFORMAT" == "HtmlLight" ]]; then
|
elif [[ "$EXPORTFORMAT" == "HtmlDark" ]] || [[ "$EXPORTFORMAT" == "HtmlLight" ]]; then
|
||||||
mv "export.tmp" "${EXPORTDIRECTORY//\"}/$FILENAME-$CURRENTTIME.html"
|
mv "$FILENAME.tmp" "${EXPORTDIRECTORY//\"}/$FILENAME-$CURRENTTIME.html"
|
||||||
|
|
||||||
elif [[ "$EXPORTFORMAT" == "Csv" ]]; then
|
elif [[ "$EXPORTFORMAT" == "Csv" ]]; then
|
||||||
mv "export.tmp" "${EXPORTDIRECTORY//\"}/$FILENAME-$CURRENTTIME.csv"
|
mv "$FILENAME.tmp" "${EXPORTDIRECTORY//\"}/$FILENAME-$CURRENTTIME.csv"
|
||||||
else
|
else
|
||||||
echo "$EXPORTFORMAT - Unknown export format"
|
echo "$EXPORTFORMAT - Unknown export format"
|
||||||
echo "Available export formats: PlainText, HtmlDark, HtmlLight, Csv"
|
echo "Available export formats: PlainText, HtmlDark, HtmlLight, Csv"
|
||||||
echo "/\ CaSe-SeNsItIvE \/\\"
|
echo "/\ CaSe-SeNsItIvE /\\"
|
||||||
if ! rm -Rf "export.tmp" ;then
|
if ! rm -Rf "$FILENAME.tmp" ;then
|
||||||
echo "Unable to delete $PWD/export.tmp"
|
echo "Unable to delete $PWD/$FILENAME.tmp"
|
||||||
fi
|
fi
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user