node-webhookjs

1.0.2 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i node-webhookjs

Weekly Downloads

1

Version

1.0.2

License

ISC

Unpacked Size

7.99 kB

Total Files

7

Last publish

Collaborators

  • victorlessa