npm i node-webhookjs
const { telegram, teams } = require('node-webhookjs')
// Instance.<method>
function methodName(req, res) {
try{
...
}catch(error) {
telegram({
token: '<TOKEN>',
chatId: '<CHAT_ID>'})
.send('Message')
.then(() => {...})
.catch(() => {...})
}
}
function methodName(req, res) {
try{
...
}catch(error) {
teams({ url: '<URL>' })
.send({message: "Teste"}, "nameMethod", "nameProject")
.then(() => {...})
.catch(() => {...})
}
}