mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-04-28 16:57:02 +00:00
adding more docker usage examples with bot, small script to gather everything and list of options for the Cli
@@ -1,3 +1,5 @@
|
|||||||
|
### 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
|
||||||
@@ -6,5 +8,66 @@ To export:
|
|||||||
|
|
||||||
$ docker run tyrrrz/discordchatexporter export -t TOKEN -c CHANNEL
|
$ docker run tyrrrz/discordchatexporter export -t TOKEN -c CHANNEL
|
||||||
|
|
||||||
|
##
|
||||||
|
|
||||||
|
### Usage with a bot instead of a session token
|
||||||
|
|
||||||
|
To get list of guilds available to a bot:
|
||||||
|
|
||||||
|
$ docker run tyrrrz/discordchatexporter guilds -t TOKEN -b
|
||||||
|
|
||||||
|
To get list of channel available to a bot on a given guild:
|
||||||
|
|
||||||
|
$ docker run tyrrrz/discordchatexporter channels -t TOKEN -b -g GUILD_ID
|
||||||
|
|
||||||
|
To get content of channel:
|
||||||
|
|
||||||
|
$ docker run tyrrrz/discordchatexporter export -t TOKEN -b -c CHANNEL
|
||||||
|
|
||||||
|
Export path is in /a in docker image, so if you need to bring the file on the host use the following command:
|
||||||
|
|
||||||
|
$ docker run -v $PWD:/a tyrrrz/discordchatexporter export -t TOKEN -b -c CHANNEL
|
||||||
|
|
||||||
|
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
|
||||||
|
done
|
||||||
|
done
|
||||||
|
```
|
||||||
|
|
||||||
|
List of options for cli call from [ExportChatOption.cs](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/DiscordChatExporter.Cli/Verbs/Options/ExportChatOptions.cs):
|
||||||
|
|
||||||
|
-c|--channel <channel_id>
|
||||||
|
[-f|--format] <PlainText|HtmlDark|HtmlLight|Csv>
|
||||||
|
[-o|--ouptput] <path to output file>
|
||||||
|
[--after] <limit export to messages after this date>
|
||||||
|
[--before] <limit export to messages before this date>
|
||||||
|
[-p|--partition] <split output by this amount of messages>
|
||||||
|
[--dateformat] <date format>
|
||||||
|
[--grouplimit] <messages group limit>
|
||||||
|
|
||||||
##
|
##
|
||||||
Credits to [@simnalamburt](https://github.com/simnalamburt)
|
Credits to [@simnalamburt](https://github.com/simnalamburt)
|
||||||
Reference in New Issue
Block a user