# slack-alert

> Slack Bot alert message

Latest version **1.0.0** (published 2017-03-10) · MIT license · 0 weekly downloads

## Install

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

## 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.0.0 |
| Published | 2017-03-10 |
| First published | 2017-03-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Matteo Maselli |
| Maintainers | daack |
| Keywords | slack |

## Links

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

## Dependencies (1)

- [@slack/client](https://npm.io/package/@slack/client.md) ^3.8.1

## Recent versions

- 1.0.0 (latest) — 2017-03-10

## README

# slack-alert :rotating_light:

Slack Bot alert message

* [Install](#install)
* [Example](#example)
* [API](#api)
* [Events](#events)

<a name="install"></a>

## Install

To install slack-alert, simply use npm:

```
npm install slack-alert --save
```

<a name="example"></a>

## Example

```javascript
const SlackAlert = require('slack-alert')

let alert = SlackAlert({
	name: 'bot',
	token: 'token',
	channel: '#channel'
})

alert.send(new Error('error'))

// multiple bots

let alert = SlackAlert([{
  name: 'foo',
  token: 'token',
  channel: '#channel'
}, {
  name: 'bar',
  token: 'token',
  channel: '#channel'
}])

alert.bot('foo').send(new Error('error'))

// different channel

alert.bot('foo').send(new Error('error'), '#another_channel')
```

<a name="api"></a>

## API

  * <a href="#constructor"><code><b>SlackAlert()</b></code></a>
  * <a href="#bot"><code>instance.<b>bot()</b></code></a>
  * <a href="#send"><code>instance.<b>send()</b></code></a>

-------------------------------------------------------
<a name="constructor"></a>

### SlackAlert(bots)

Creates a new instance of SlackAlert.

-------------------------------------------------------
<a name="bot"></a>

### instance.bot(bot_name)

Change the current bot

-------------------------------------------------------
<a name="send"></a>

### instance.send(error[, channel])

Send a new error to slack

* `error`, Error object or a string
* `channel`, Slack channel

<a name="events"></a>

## Events

  * <a href="#error"><code><b>error</b></code></a>
  * <a href="#sent"><code><b>sent</b></code></a>

-------------------------------------------------------
<a name="error"></a>

### instance.on('error', (err) => {})

-------------------------------------------------------
<a name="sent"></a>

### instance.on('sent', (slack_confirm) => {})

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