node-webhookjs
v1.0.2
Published
This project was created to facilitate chat integration
Downloads
3
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(() => {...})
}
}