Skip to content

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

Notifications You must be signed in to change notification settings

cato-a/CODPM-API-Discord

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

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}

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

About

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

Topics

Resources

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •