index.js
function send(message, callback) {
  const suppliedCallback = callback || function () {};
  if (!message) {
    return suppliedCallback(new Error('No message'));
  }
  const requestParams = {
    url: this.webhook,
    body: extend(this.options, { text: message }),
    json: true
  };
  return request.post(requestParams, function (err, res, body) {
    if (err || body !== 'ok') {
      return suppliedCallback(err || new Error(body));
    }
    return suppliedCallback(null, body);
  });
}
function send(message, callback) {
  const suppliedCallback = callback || function () {};
  if (!message) {
    return suppliedCallback(new Error('No message'));
  }
  const requestParams = {
    url: this.webhook,
    body: extend(this.options, { text: message }),
    json: true
  };
  return request.post(requestParams, function (err, res, body) {
    if (err || body !== 'ok') {
      return suppliedCallback(err || new Error(body));
    }
    return suppliedCallback(null, body);
  });
}
function send ( message , callback ) { const suppliedCallback = callback || function ( ) { } ; if ( ! message ) { return suppliedCallback ( new Error ( 'No message' ) ) ; } const requestParams = { url : this . webhook , body : extend ( this . options , { text : message } ) , json : true } ; return request . post ( requestParams , function ( err , res , body ) { if ( err || body !== 'ok' ) { return suppliedCallback ( err || new Error ( body ) ) ; } return suppliedCallback ( null , body ) ; } ) ; }
Handles the sending of a message to an Incoming webhook
@param {text} Message text
@param {function} Callback function for post execution
Handles the sending of a message to an Incoming webhook