1.2.4 • Published 9 years ago
pretty-slack v1.2.4
Pretty-Slack
Use this to post pretty messages to Slack using their API.
Usage
npm install pretty-slack
var PrettySlack = require('pretty-slack');
var slack = new PrettySlack('<YOUR-API-KEY>');
slack.chat('#<channel>', '<message>', {attachments}, function(err, posted, resp){
console.log(err, posted, resp);
});
channel
: the channel you want to post tomessage
: a string to post to the channel (can be an empty string)options
: an object with optional attachments for Slack. This follows the same convention as Slack's documentationcallback
: the function signature should be of the form of(err, posted, response)
whereerr
is the standard error of the request,posted
is a boolean response from Slack if your message was successfully posted, andresponse
is the body of the response from the Slack API.