Skip to content

samuelcouch/slack-attack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

💥 Slack-Attack 🤘

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.

About

💥 Slack API wrapper 🤘

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published