A simple JavaScript script to parse the cod.pm API and display formatted text in a Discord channel via the Discord webhook API.
The configuration variables are at the top of the JavaScript file.
The DISCORD_WEBHOOK
variable should be either of the following formats.
https://discord.com/api/webhooks/{webhook.id}/{webhook.token}
https://discord.com/api/webhooks/{webhook.id}/{webhook.token}/messages/{message.id}
Option 1) Via NodeJS directly.
node CODPM-API-Discord.js
Option 2) Via a NodeJS Docker container.
docker run --detach --name CODPM-API-Discord -e 'NODE_ENV=production' -v "$PWD/CODPM-API-Discord.js":/usr/src/app/run.js -w /usr/src/app node:current-alpine node run.js