Send messages to slack with incoming webhooks.
$ npm install slack-incoming-webhookvar slack = require('slack-incoming-webhook');
var send = slack(opts);
// send = send(otherOpts)
send(message);
send(message, cb);
send(message, opts, cb);If invoked with a single opts object, it configures and returns a slack client.
It can be chained, like creating clients for posting to different channels:
var client = slack({
url: '{webhook url}',
});
var dev = client({
channel: '#dev',
});
var ops = client({
channel: '#ops',
});Sends a message to the configured Webhook URL. You can override options with opts,
the optional callback is called when the request is completed.
Slack accepts the following options (besides the ones listed in the webhook docs, like username, channel, icon_url, icon_emoji, attachments):
url: webhook url for slack, if not specified, it falls back toprocess.env.SLACK_WEBHOOK_URLicon: setsicon_emojifor values like:moneybag:andicon_urlfor values that look like an url
MIT