mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-04-28 08:46:44 +00:00
Updated Docker usage instructions (markdown)
@@ -1,5 +1,3 @@
|
|||||||
### Usage with session token and ID of channel
|
|
||||||
|
|
||||||
To pull the latest version:
|
To pull the latest version:
|
||||||
|
|
||||||
$ docker pull tyrrrz/discordchatexporter
|
$ docker pull tyrrrz/discordchatexporter
|
||||||
@@ -8,66 +6,57 @@ To export:
|
|||||||
|
|
||||||
$ docker run tyrrrz/discordchatexporter export -t TOKEN -c CHANNEL
|
$ docker run tyrrrz/discordchatexporter export -t TOKEN -c CHANNEL
|
||||||
|
|
||||||
##
|
To export using a Bot Token just add `-b`:
|
||||||
|
|
||||||
### Usage with a bot instead of a session token
|
$ docker run tyrrrz/discordchatexporter export -t TOKEN -c CHANNEL -b
|
||||||
|
|
||||||
To get list of guilds available to a bot:
|
The CLI options can be found at:
|
||||||
|
|
||||||
$ docker run tyrrrz/discordchatexporter guilds -t TOKEN -b
|
$ docker run -it tyrrrz/discordchatexporter
|
||||||
|
#
|
||||||
|
|
||||||
To get list of channel available to a bot on a given guild:
|
A docker image's export path is in /a, to export the file to host use:
|
||||||
|
|
||||||
$ docker run tyrrrz/discordchatexporter channels -t TOKEN -b -g GUILD_ID
|
$ docker run -v $PWD:/a tyrrrz/discordchatexporter export -t TOKEN -c CHANNEL
|
||||||
|
|
||||||
To get content of channel:
|
#
|
||||||
|
|
||||||
$ docker run tyrrrz/discordchatexporter export -t TOKEN -b -c CHANNEL
|
A script to gather every channel you're on:
|
||||||
|
|
||||||
Export path is in /a in docker image, so if you need to bring the file on the host use the following command:
|
#!/usr/bin/env bash
|
||||||
|
# Info: https://github.com/Tyrrrz/DiscordChatExporter/wiki
|
||||||
|
TOKEN=<token>
|
||||||
|
TOKENTYPE=<BOT/USER>
|
||||||
|
|
||||||
$ docker run -v $PWD:/a tyrrrz/discordchatexporter export -t TOKEN -b -c CHANNEL
|
if [[ "$TOKENTYPE" == "BOT" ]]; then
|
||||||
|
ISBOTYES=-b
|
||||||
And finally a small script to gather every channel your bot is on:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
MY_TOKEN_ID=<TOKEN ID HERE>
|
|
||||||
|
|
||||||
# get list of guilds
|
|
||||||
guilds=$(docker run --rm -v $PWD:/a tyrrrz/discordchatexporter guilds -t $MY_TOKEN_ID -b | 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 processing $guild_name with id $guild_id
|
|
||||||
|
|
||||||
channels=$(docker run --rm -v $PWD:/a tyrrrz/discordchatexporter channels -t $MY_TOKEN_ID -b -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 processing $channel_name in guild $guild_name with channel id: $channel_id
|
|
||||||
result=$(docker run --rm -v $PWD:/a tyrrrz/discordchatexporter export -t $MY_TOKEN_ID -b -c $channel_id -o /a/${guild_name}_${channel_name}.html)
|
|
||||||
if [ ! $? ]; then
|
|
||||||
echo an error happenned: $result
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
echo channel saved as ${guild_name}_${channel_name}.html
|
|
||||||
fi
|
fi
|
||||||
done
|
|
||||||
done
|
|
||||||
```
|
|
||||||
|
|
||||||
List of options for cli call from [ExportChatOption.cs](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/DiscordChatExporter.Cli/Verbs/Options/ExportChatOptions.cs):
|
guilds=$(docker run --rm -v $PWD:/a tyrrrz/discordchatexporter guilds -t $TOKEN $ISBOTYES | tr -d '[:blank:]')
|
||||||
|
|
||||||
-c|--channel <channel_id>
|
for guild in $guilds; do
|
||||||
[-f|--format] <PlainText|HtmlDark|HtmlLight|Csv>
|
guild_id=$(echo $guild | cut -d '|' -f 1)
|
||||||
[-o|--ouptput] <path to output file>
|
guild_name=$(echo $guild | cut -d '|' -f 2)
|
||||||
[--after] <limit export to messages after this date>
|
echo "Guild: $guild_name - $guild_id"
|
||||||
[--before] <limit export to messages before this date>
|
|
||||||
[-p|--partition] <split output by this amount of messages>
|
channels=$(docker run --rm -v $PWD:/a tyrrrz/discordchatexporter channels -t $TOKEN $ISBOTYES -g $guild_id | tr -d '[:blank:]')
|
||||||
[--dateformat] <date format>
|
for channel in $channels; do
|
||||||
[--grouplimit] <messages group limit>
|
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
|
||||||
|
|
||||||
##
|
##
|
||||||
Credits to [@simnalamburt](https://github.com/simnalamburt)
|
Special thanks to [@simnalamburt](https://github.com/simnalamburt) (Dockerize) and [@shlagevuk](https://github.com/shlagevuk) (Script)
|
||||||
Reference in New Issue
Block a user