node-webhookjs

This project was created to facilitate chat integration

Usage no npm install needed!

<script type="module">
  import nodeWebhookjs from 'https://cdn.skypack.dev/node-webhookjs';
</script>

README

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