Created
February 18, 2022 15:38
-
-
Save willsheppard/f9b7cc9b130784ffd7bd8f144cf892f8 to your computer and use it in GitHub Desktop.
Stream filter for discord chat export
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if .[0][2] == "timestamp" then .[1],"\t" else empty end, | |
if .[0][2] == "content" then .[1],"\t" else empty end, | |
if .[0][2] == "author" and .[0][3] == "name" then .[1],"\t" else empty end, | |
if .[0][2] == "author" and .[0][3] == "nickname" then .[1],"\t" else empty end, | |
if .[0][2] == "attachments" and .[0][4] == "url" then .[1],"\t" else empty end, | |
if .[0][2] == "mentions" and (.[1] | not) then "\n" else empty end |
However, if your aim is to output HTML then just use the existing HTML export options in DiscordChatExporter.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Input
A JSON format export from DiscordChatExporter.
Because this JSON document could be so large, we have to use jq's streaming feature, which has a learning curve.
Example:
Command
Output
Tab Separated Values (TSV):