# slack-attack

> Use this to post pretty formatted messages to Slack

Latest version **1.2.1** (published 2015-11-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install slack-attack
pnpm add slack-attack
yarn add slack-attack
bun add slack-attack
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.1 |
| Published | 2015-11-17 |
| First published | 2015-09-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Sam Couch |
| Maintainers | samuelcouch |
| Keywords | Slack, chat |

## Links

- npm: https://www.npmjs.com/package/slack-attack
- Repository: https://github.com/samuelcouch/pretty-slack
- Homepage: https://github.com/samuelcouch/slack-attack#readme
- Issues: https://github.com/samuelcouch/slack-attack/issues
- npm.io page: https://npm.io/package/slack-attack

## Dependencies (5)

- [url](https://npm.io/package/url.md) ^0.10.3
- [path](https://npm.io/package/path.md) ^0.11.14
- [util](https://npm.io/package/util.md) ^0.10.3
- [jsdoc](https://npm.io/package/jsdoc.md) ^3.3.0-beta2
- [request](https://npm.io/package/request.md) ^2.58.0

## Recent versions

- 1.2.1 (latest) — 2015-11-17
- 1.2.0 — 2015-11-16
- 1.0.0 — 2015-09-10

## README

# :boom: Slack-Attack :metal:
Use this to as an interface to the Slack web API.

## Usage
`npm install slack-attack`

```javascript
    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](https://api.slack.com/docs/attachments)
* `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.

---
_Source: https://npm.io/package/slack-attack · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
