Skip to content

Tool to trigger system errors for telegram or microsoft teams

Notifications You must be signed in to change notification settings

victorLessa/node-webhookjs

Repository files navigation

Dependências

Instalação

  npm i node-webhookjs

Exemplo

const { telegram, teams } = require('node-webhookjs')
// Instance.<method>

Enviar mensagem de texto usando o telegram

function methodName(req, res) {
    try{
    	...
    }catch(error) {
        telegram({
          token: '<TOKEN>', 
          chatId: '<CHAT_ID>'})
          .send('Message')
          .then(() => {...})
          .catch(() => {...})
     }
}

Enviar mensagem de texto usando o teams

function methodName(req, res) {
    try{
    	...
    }catch(error) {
        teams({ url: '<URL>' })
          .send({message: "Teste"}, "nameMethod", "nameProject")
          .then(() => {...})
          .catch(() => {...})
     }
}

About

Tool to trigger system errors for telegram or microsoft teams

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published