Created Scheduling exports on Windows (markdown)

Yudi
2018-10-13 18:40:54 -03:00
parent 641c6d01db
commit bafec65375

@@ -0,0 +1,82 @@
We'll be using [DiscordChatExporter Cli](https://github.com/Tyrrrz/DiscordChatExporter/releases/latest) for this Guide.
#
**1.** Open a text editor such as Notepad and paste:
```
# Info: https://github.com/Tyrrrz/DiscordChatExporter/wiki
$TOKEN = "<token>"
$TOKENTYPE = "<BOT/USER>"
$CHANNEL = "<channel>"
$EXEPATH = "<exe>"
$FILENAME = "<name>"
$EXPORTDIRECTORY = "<dir>"
$EXPORTFORMAT = "<format>"
# Available export formats: PlainText, HtmlDark, HtmlLight, Csv
cd $EXEPATH
If($TOKENTYPE -match "BOT"){$ISBOTYES = "-b"}
Else{$ISBOTYES = ""}
.\DiscordChatExporter.Cli.exe export -t $TOKEN $ISBOTYES -c $CHANNEL -f $EXPORTFORMAT -o exporttmp
$Date = Get-Date -Format "yyyy-MMM-dd HH-mm"
If($EXPORTFORMAT -match "PlainText"){mv exporttmp -Destination "$EXPORTDIRECTORY\$FILENAME-$Date.txt"}
ElseIf($EXPORTFORMAT -match "HtmlDark"){mv exporttmp -Destination "$EXPORTDIRECTORY\$FILENAME-$Date.html"}
ElseIf($EXPORTFORMAT -match "HtmlLight"){mv exporttmp -Destination "$EXPORTDIRECTORY\$FILENAME-$Date.html"}
ElseIf($EXPORTFORMAT -match "Csv"){mv exporttmp -Destination "$EXPORTDIRECTORY\$FILENAME-$Date.csv"}
exit
```
**2.** Replace:
`<token>` with your [Token](https://github.com/Tyrrrz/DiscordChatExporter/wiki/Obtaining-Token-and-Channel-IDs)
`<BOT/USER>` If the Token is from a bot replace it with `BOT`, if it's from a user, `USER`
`<channel>` with a [Channel ID](https://github.com/Tyrrrz/DiscordChatExporter/wiki/Obtaining-Token-and-Channel-IDs)
`<exe>` with the .exe directory path (e.g. C:\Users\User\Desktop\DiscordChatExporter)
`<name>` with a filename without spaces
`<dir>` with the export directory (e.g. C:\Users\User\Documents\Exports)
`<format>` with one of the available export formats
Make sure not do delete the quotes (")
**3.** Save the file as `filename.ps1` not `.txt`
## Export at Startup
**1.** Press Windows + R, type `shell:startup` and press ENTER
**2.** Paste `filename.ps1` or a shortcut to this folder
## Scheduling with Task Manager
Please notice your computer must be turned on so the exportation can occur.
**1.** Press Windows + R, type `taskschd.msc` and press ENTER
**2.** Select `Task Scheduler Library`, create a Basic Task and follow the instructions on-screen
<img src="https://i.imgur.com/MHRVGDi.png" height="500" />
[ ![](https://i.imgur.com/m2DKhA8.png) ](https://i.imgur.com/3gHkF0t.png)
**3.** At 'Start a Program', write `powershell -file "C:\path\to\filename.ps1"` in Program/script text box
![](https://i.imgur.com/FGtWRod.png)
**4.** Click 'Yes'
![](https://i.imgur.com/DuaRBt3.png)
**5.** Click 'Finish'
![](https://i.imgur.com/LHgXp9Q.png)