Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Configuration

ShadiestGoat edited this page Jan 22, 2022 · 7 revisions

You can customise this project quite a bit. This is accessed through the a .env file (filename changeable), or through env variables. A GUI settings menu is in the TODO: list.

Eg. in a .env file (prefered method):

TOKEN="..."
ID_TYPE=CHANNEL
ID=123456789123456789
...etc

Eg. as normal env vars:

TOKEN="..." ID_TYPE=CHANNEL ID=123456789123456789 ./DiscordChatExporter

Config Options

Variable Accepted Values Description Default
IGNORE_ENV_FILE Boolean If set to true, it will ignore any env file set false
ENV_FILENAME String The name of the file from which to load the vars from .env
HM_AUTO Boolean Advanced users only! Wether it will auto fetch the 'heading mask', to hide that youre using this app from discord. Check (this guide)[Manual Heading Masking] for more info true
TOKEN String Your user token
ID_TYPE "USER", "CHANNEL", "GUILD" The type of ID you input. This will auto resolve into the correct channel ID if not set to "CHANNEL" "CHANNEL"
ID Snowflakes, seperated by a space The IDs you want to resolve. They must all share the same type, specified in ID_TYPE
IGNORE_NSFW_CHANNEL Boolean If true, it will ignore nsfw channels when resolving a guild ID false
DOWNLOAD_MEDIA Boolean Should it download the attachments (including image embeds) true
EXPORT_TYPE "TEXT", "JSON", "HTML" If its "TEXT", its uses EXPORT_PLAIN_FORMAT to format itself. You can parse this by splitting it by newline, but you can also use "JSON", which has all the info you need. "HTML" is the most 'visual' of them all, for when you want to see them yourself, and make it look like discord. Check theming options for HTML "JSON"
EXPORT_PLAIN_FORMAT String Uses our (templates)[#Templates], with the following vars: MSG_TYPE, AUTHOR_NAME, AUTHOR_ID, TIMESTAMP (Timestamp, utc), WAS_EDITED (boolean "true" or "false"), CONTENT (msg content, but if the message is just an attachment, the content is just the attachment url), HAS_ATTACHMENT (boolean), ATTACHMENT_URL (a , seperated list, each item being wrapped in a "), HAS_STICKERS (the msg has a sticker), STICKER_IDS (a , seperated list, each item wrapped in "). [{{%AUTHOR_NAME}}]: "{{%CONTENT}}"
IGNORE_SYSTEM_MSGS Boolean Ignore the 'system' messages. Messages like calls, add/remove users, etc false
EXPORT_HTML_THEME String Only applies when EXPORT_TYPE is "HTML". It's the theme used for export. Check out the theming guide dark
EXPORT_LOCATION String The export location. Uses (templates)[#Templates], in which the only var available is CHANNEL_ID output/{{%CHANNEL_ID}} (cross platform)
MSG_LIMIT_NUM Integer or "all" How many messages this should download, per channel. If it's "all", it will download all the messages in that channel "all"
BEFORE_ID Snowflake, nil Only download messages before this ID. Not mutually exclusive w/ BEFORE_ID. Not supported on multi channel downloads nil
AFTER_ID Snowflake, nil Only download messages after this ID. Not mutually exclusive w/ BEFORE_ID. Not supported on multi channel downloads nil
BEFORE_TIME Timestamp, nil Messages before this time. When you want all messages between certain 2 periods. Not mutually exclusive w/ anything nil
AFTER_TIME Timestamp, nil Messages after this time. When you want all messages between certain 2 periods. Not mutually exclusive w/ anything nil
USE_LIMIT_50 Boolean If true, use limit=50 for the downloader, if false, use limit=100 for it. When its 50, its twice as slow, but its safer, since thats the way that a normal discord client works true

Types

Type Description Values
Boolean Yes or no Case insensitive, true: "true", "t", "yes", "y", "1". false: "false", "f", "yes", "y", "0"
nil An empty config option. Has no value, or empty string ("") Empty, ""
Snowlake A discord ID A string of 18 digits
Timestamp A Epoch Unix Timestamp (microseconds) Epoch Unix Timestamp
String A bunch of Characters Anything, really

Templates

This project uses templates for formating & the like. The format for a template is {{%VAR_NAME}}. Eg. [{{%AUTHOR_NAME}}]: {{%CONTENT}}

Clone this wiki locally