lib/logger.js
function notifySlack ({ channel, text, webhook }) {
  return fetch(webhook, {
    body: JSON.stringify({
      channel,
      text
    }),
    headers: {
      'Content-Type': 'application/json'
    },
    method: 'POST'
  })
    .then(response => response.text())
    .catch(err => {
      logToErrorConsole('Error posting to Slack webhook')
      logToErrorConsole(err)
      return err
    })
}
function notifySlack ({ channel, text, webhook }) {
  return fetch(webhook, {
    body: JSON.stringify({
      channel,
      text
    }),
    headers: {
      'Content-Type': 'application/json'
    },
    method: 'POST'
  })
    .then(response => response.text())
    .catch(err => {
      logToErrorConsole('Error posting to Slack webhook')
      logToErrorConsole(err)
      return err
    })
}
function notifySlack ( { channel , text , webhook } ) { return fetch ( webhook , { body : JSON . stringify ( { channel , text } ) , headers : { 'Content-Type' : 'application/json' } , method : 'POST' } ) . then ( response => response . text ( ) ) . catch ( err => { logToErrorConsole ( 'Error posting to Slack webhook' ) logToErrorConsole ( err ) return err } ) }
Send a message to slack by making a request to a webhook.
Send a message to slack by making a request to a webhook .