Download all your Discord messages locally in json
files.
- Install the dependencies
$ npm install
$ DATA_PATH=<PATH> TOKEN=<TOKEN> npm start
Variable | Description | Required |
---|---|---|
DATA_PATH |
Path to the directory where the messages will be stored. | true |
TOKEN |
User's authorization token. Used for the API calls when getting the messages. | true |
SYNC_GUILDS |
Optional . If you also want to synchronize the messages of a guild, you can include the ids separated by comma, e.g. id1,id2,id3 . |
false |
INTERVAL |
Optional . You can specity the interval, in miliseconds, when the messages should be synchronized, e.g. every 10 minutes. If not specified, the script will exit after synchronizing once. |
false |
You can also build the project if you don't want to rely on ts-node
.
$ npm run build
$ DATA_PATH=<PATH> TOKEN=<TOKEN> node dist/index.js
If you want to index the messages in Elasticsearch
, you can find an example Logstash
config in logstash.conf
.
Note: The example config uses the Prune
plugin which doesn't come installed by default. To install it, run from the Logstash installation folder:
./bin/logstash-plugin install logstash-filter-prune
More details here.
Open sourced under the MIT license.