/CODPM-API-Discord

A simple JavaScript script to parse the cod.pm API and display formatted text in a Discord channel via the Discord webhook API

Primary LanguageJavaScript

CODPM-API-Discord

A simple JavaScript script to parse the cod.pm API and display formatted text in a Discord channel via the Discord webhook API.

Screenshots

ANSI sample


Bordered sample

Configuration

The configuration variables are at the top of the JavaScript file.

Adjust the DISCORD_WEBHOOK variable and add the correct ID, TOKEN for the Webhook.

const DISCORD_WEBHOOK = new WebhookClient({ id: "<id>", token: "<token>" });

Running the script

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