@patu/api-discord-message

0.1.4 • Public • Published

discord-notifier

Standalone service:

TOKEN= CHANNEL_ID= PORT= npx @patu/api-discord-message

Import as part of project:

Provide values with envs .env

CHANNEL_ID=
TOKEN=
PORT=

then call start

import { start } from "notifier"

start().catch(e => {
    console.error(e);
});

or pass values directly to start:

import { start } from "notifier"

start({
    channelId: "",
    token: "",
    port: 9999
}).catch(e => {
    console.error(e);
});

Send message:

curl  -X POST \
  'http://0.0.0.0:9999' \
  --header 'Accept: */*' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "message": "Test message"
}'

Readme

Keywords

none

Package Sidebar

Install

npm i @patu/api-discord-message

Weekly Downloads

2

Version

0.1.4

License

ISC

Unpacked Size

17.3 kB

Total Files

11

Last publish

Collaborators

  • patu