Node-Notifyy
Module to send error messages to you on Telegram using Notifyy-McNotifyFace.
Installing
npm i node-notifyy
Constructor options
users
String or array with the tokens for the users we should notify.
title
A default title for your messages.
E.g Application crashed
or We've been overrun by sub-atomic monkeys!
handleErrors
Default: false
Enable this if you want to catch all errors globally and send notifications for them.
Use with caution as this might intercept other error handlers in some situations.
Methods
send
Sends a notification.
Returns a Promise
Available parameters
Key | Required | Type |
---|---|---|
title | YES (if no message) | string |
message | YES (if no title) | string |
url | NO | url-encoded string |
code | NO | string |
notification | NO | boolean |
Examples
Send a message
const Notifyy = ;let notifyy = users: '*TOKEN*' ; notifyy;
Send a message without notification
const Notifyy = ;let notifyy = users: '*TOKEN*' ; notifyy;
Use as a notification for a single try/catch
const Notifyy = ;let notifyy = users: '*TOKEN*' ; try ; catch error notifyy;
With shorthand for standard errors
const Notifyy = ;let notifyy = users: '*TOKEN*'; try ; catch error notifyy;
Use to catch all errors
const Notifyy = ;let notifyy = users: '*TOKEN*' handleErrors: true ; ;