TOKEN= CHANNEL_ID= PORT= npx @patu/api-discord-message
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"
}'