1.2.1 • Published 8 years ago

slack-attack v1.2.1

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

:boom: Slack-Attack :metal:

Use this to as an interface to the Slack web API.

Usage

npm install slack-attack

    var SlackAttack = require('slack-attack');
    var slack = new SlackAttack('<YOUR-API-KEY>');

    var options = { 'username': 'Test Bot',
                    'icon_emoji': ':robot_face:',
                    'link_names': 1 };


    slack.chat('#<channel>', '<message>', options, function(err, posted, resp){
      console.log(err, posted, resp);
    });
  • channel: the channel you want to post to
  • message: 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 documentation
  • callback: the function signature should be of the form of (err, posted, response) where err is the standard error of the request, posted is a boolean response from Slack if your message was successfully posted, and response is the body of the response from the Slack API.
1.2.1

8 years ago

1.2.0

8 years ago

1.0.0

9 years ago