slack-alert
v1.0.0
Published
Slack Bot alert message
Readme
slack-alert :rotating_light:
Slack Bot alert message
Install
To install slack-alert, simply use npm:
npm install slack-alert --saveExample
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')API
- SlackAlert()
- instance.bot()
- instance.send()
SlackAlert(bots)
Creates a new instance of SlackAlert.
instance.bot(bot_name)
Change the current bot
instance.send(error[, channel])
Send a new error to slack
error, Error object or a stringchannel, Slack channel
Events
- error
- sent
