1.0.2 • Published 4 years ago

node-webhookjs v1.0.2

Weekly downloads
3
License
ISC
Repository
github
Last release
4 years ago

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(() => {...})
     }
}